muban大师 发表于 2020-3-6 10:06:20

织梦现键盘左、右方向键翻页的方法

织梦dedecms现键盘左、右方向键翻页的方法。
        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', = "上一篇: ";
        修改为
        $this->PreNext['pre', = "上一篇: ";
        找到
        $this->PreNext['next', = "下一篇: ";
        修改为
        $this->PreNext['next', = "下一篇: ";
       
        3、列表页调用代码修改
        打开 include/arc.listview.class.php 文件
        找到
        $prepage.="\r\n";
        修改为
        $prepage.="\r\n";
        找到
        $nextpage.="\r\n";
        修改为
        $nextpage.="\r\n";
页: [1]
查看完整版本: 织梦现键盘左、右方向键翻页的方法