emlog添加上、下一文章链接
网上找到的,可以直接拿来用,我把图片放到自己网站上了。如果你有这个需求也可以自己添加。以下是代码,需放到echo_log.php中,即可达到效果。
<style>
#prevlog{width:40px;height:80px;background:url(https://note.huweiming.cn/img/syz.png) no-repeat; position:fixed;left:50%;top:380px;margin-left:-530px;filter:alpha(Opacity=60);-moz-opacity:0.6;opacity:0.6;z-index:9999;}
#prevlog a,#nextlog a{width:40px;height:80px;display:block;}
#prevlog:hover,#nextlog:hover{filter:alpha(Opacity=100);-moz-opacity:1;opacity:1;}
#nextlog{width:40px;height:80px;background:url(https://note.huweiming.cn/img/xyz.png) no-repeat; position:fixed;left:50%;top:380px;margin-left:490px;filter:alpha(Opacity=60);-moz-opacity:0.6;opacity:0.6;z-index:9999;}
*html #prevlog, *html #nextlog{position: absolute;top:expression(eval(document.documentElement.scrollTop));}
</style>
<?php extract($neighborLog);if($prevLog){
echo '<div id="prevlog"><a href="'.Url::log($prevLog['gid']).'" title="'.$prevLog['title'].'"></a></div>';}
else{
echo '<div id="prevlog"><a href="#" title="没有上一篇了"></a></div>';};
if($nextLog){
echo '<div id="nextlog"><a href="'.Url::log($nextLog['gid']).'" title="'.$nextLog['title'].'"></a></div>';}
else{
echo '<div id="nextlog"><a href="#" title="没有下一篇了"></a></div>';};?>
我感觉有点破坏我这个网站的整体性,我改造了一下,效果见本博客,我改造后的代码如下:
<style>
#prevlog{width:40px;height:80px;background:url(https://note.huweiming.cn/img/syz.png) no-repeat; filter:alpha(Opacity=60);-moz-opacity:0.6;opacity:0.6;z-index:9999;}
#prevlog a{width:40px;height:80px;display:block;}
#nextlog a{width:40px;height:80px;display:block;}
#prevlog:hover,#nextlog:hover{filter:alpha(Opacity=100);-moz-opacity:1;opacity:1;}
#nextlog{width:40px;height:80px;background:url(https://note.huweiming.cn/img/xyz.png) no-repeat;filter:alpha(Opacity=60);-moz-opacity:0.6;opacity:0.6;z-index:9999;}
*html #prevlog, *html #nextlog{position: absolute;top:expression(eval(document.documentElement.scrollTop));}
</style>
<div>
<?php extract($neighborLog);if($prevLog){
echo '<div id="prevlog" style="float:left;"><a href="'.Url::log($prevLog['gid']).'" title="'.$prevLog['title'].'"></a></div>';
}
else{
echo '<div id="prevlog" style="float:left;"><a href="#" title="没有上一篇了"></a></div>';};
if($nextLog){
echo '<div id="nextlog" style="float:right;"><a href="'.Url::log($nextLog['gid']).'" title="'.$nextLog['title'].'"></a></div>';}
else{
echo '<div id="nextlog" style="float:right;"><a href="#" title="没有下一篇了"></a></div>';};?></div>
<div style="clear:both;"></div>
通过float:left与float:right来设置到同一行,但是设置之后需要clear。
经过我再次修改,与主题吻合度要好一点了,效果图:
基本上可以用了,没有很突兀的感觉,先用着吧。
分类:
浏览:1345

