,文章介绍,1、复制js代码到内容页和列表页
织梦模板中,$(document).ready(function(){ , var prevpage=$("#pre").attr("href"); , var nextpage=$("#next").attr("href"); , $("body").keydown(function(event){ , if(event.keyCode==37 && prevpage!=undefined) location=prevpage; , if(event.keyCode==39 && nextpage!=undefined) location=nextpage; , , }); , }); , ,2、内容页调用代码修改,打开 include/arc.archives.class.php 文件,找到,$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";,修改为,$this->PreNext['pre'] = "上一篇:<a id='pre' href='$mlink'>{$preRow['title']}</a> ";,找到,$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";,修改为,$this->PreNext['next'] = "下一篇:<a id='next' href='$mlink'>{$nextRow['title']}</a> ";, ,3、列表页调用代码修改,打开 include/arc.listview.class.php 文件,找到,$prepage.="<a href='".$purl."PageNo=$prepagenum'>上一页</a>\r\n";,修改为,$prepage.="<a id='pre' href='".$purl."PageNo=$prepagenum'>上一页</a>\r\n";,找到,$nextpage.="<a href='".$purl."PageNo=$nextpagenum'>下一页</a>\r\n";,修改为,$nextpage.="<a id='next' href='".$purl."PageNo=$nextpagenum'>下一页</a>\r\n";