欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

代理加盟

2023全新代理計(jì)劃,一站式模板建站,銅牌代理低至699元送終身VIP,獨(dú)立代理后臺(tái),自營(yíng)貼牌。

您現(xiàn)在的位置: 麥站網(wǎng) > 織夢(mèng)大學(xué) > 使用教程 >

DedeCMS實(shí)現(xiàn)靜態(tài)列表支持鍵盤左右翻頁

來源:本站原創(chuàng) 發(fā)布時(shí)間:2019-03-31 13:42:48熱度: ℃我要評(píng)論(0

麥站模板建站平臺(tái)(10年經(jīng)驗(yàn)),服務(wù)數(shù)萬家企業(yè),固定透明報(bào)價(jià)。域名注冊(cè)、主機(jī)/服務(wù)器、網(wǎng)站源碼一站式服務(wù)。實(shí)體公司,專業(yè)團(tuán)隊(duì),值得選擇!超過1000套模板已登記版權(quán),合規(guī)合法建站,規(guī)避版權(quán)風(fēng)險(xiǎn)!【點(diǎn)擊獲取方案】

       DedeCMS列表頁支持鍵盤翻上、下頁功能會(huì)讓用戶體驗(yàn)翻頁十分方便,SEO博客、圖片站采用這樣的功能將為網(wǎng)站帶來更多的PV。開發(fā)上、下翻頁功能并不復(fù)雜,結(jié)合DedeCMS,秀站網(wǎng)SEO整合了這個(gè)功能,并修正首頁和第一頁分頁內(nèi)容重復(fù)問題,以適合SEO優(yōu)化。

支持鍵盤左右鍵翻頁JS部分

<script type="text/javascript" src="jquery.js"></script><!--引入jquery-->
<script type="text/javascript"> $(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;
    });
 }); 
</script>

       控制的列表上、下頁<a>標(biāo)簽如下

<a id="pre" href="list_1_1">上一頁</a>
<a id="next" href="list_1_3">下一頁</a>

       但是DedeCMS默認(rèn)的上、下頁格式并沒有單獨(dú)調(diào)用的標(biāo)簽。下面是實(shí)現(xiàn)方法:

靜態(tài)分頁單獨(dú)調(diào)用上下頁鏈接

       打開/include/arc.listview.class.php,修改靜態(tài)分頁列表部分(動(dòng)態(tài)分頁感興趣的童鞋自己研究一下吧),找到

return $plist;
}
/**
 *  獲取動(dòng)態(tài)的分頁列表

       前面加上

$plist = '';
if(preg_match('/index/i', $listitem)) $plist .= $indexpage;
if(preg_match('/pre/i', $listitem)) $plist .= $prepage;
if(preg_match('/pageno/i', $listitem)) $plist .= $listdd;
if(preg_match('/next/i', $listitem)) $plist .= $nextpage;
if(preg_match('/end/i', $listitem)) $plist .= $endpage;
if(preg_match('/option/i', $listitem)) $plist .= $optionlist;
if(preg_match('/info/i', $listitem)) $plist .= $maininfo;

       這樣修改,按照自己的實(shí)際需求,可以單獨(dú)調(diào)用首頁鏈接、上一頁鏈接、頁數(shù)、下一頁鏈接、尾頁鏈接、分頁信息等。調(diào)用方法

{dede:pagelist listitem="pre"/}
{dede:pagelist listitem="next"}
{dede:pagelist listitem="index"}
{dede:pagelist listitem="option"}
{dede:pagelist listitem="pageno"}
{dede:pagelist listitem="info"}

       調(diào)用出來的HTML樣式如下:

<p class="pages">
 <ul>
  <li><a href="list_3_1.html">上一頁</li>
  <li class="thisclass"><a href="list_3_2.html">2</a></li>
  <li><a href="list_3_3.html">3</a></li>
  <li><a href="list_3_2.html">下一頁</a></li>
  <li><a href="list_3_3.html">末頁</a></li>
  <li><span class="pageinfo">共 <strong>3</strong>頁<strong>11</strong>條</span></li>
 </ul>
</p>

       實(shí)現(xiàn)鍵盤翻頁需要綁定靜態(tài)分頁的上一頁和下一頁<a>標(biāo)簽的ID,默認(rèn)是沒有ID,打開include/arc.listview.class.php,找到

/**
 *  獲取靜態(tài)的分頁列表

       繼續(xù)往下,找到

 $prepage.="<li><a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一頁</a></li>\r\n";

       修改為

 $prepage.="<li><a id='pre' href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一頁</a></li>\r\n";

       找到

 $nextpage.="<li><a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一頁</a></li>\r\n";

       修改為

 $nextpage.="<li><a id='next' href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一頁</a></li>\r\n";

    轉(zhuǎn)載請(qǐng)注明來源網(wǎng)址:http://mengdiqiu.com.cn/dedecms_jq/1401.html

    發(fā)表評(píng)論

    評(píng)論列表(條)

       
      QQ在線咨詢
      VIP限時(shí)特惠