本文分享的是一篇很多EMLOG站長都在找的網站文章內頁添加上一篇與下一篇按鈕。

按鈕代碼
<style> #prevlog{width:40px;height:80px;background:url(圖片地址) 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(圖片地址) 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>';};?>
說明:
把以下代碼復制粘貼到當前模板的echo_log.php文件的任意一個位置即可。
左右按鈕圖片下方已經提供,自行上傳到服務器,再更改一下代碼里的圖片地址為正確的圖片地址即可。
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
相關文章
暫無評論...