前面有写过修改源文件的方法实现点击图片进入下一分页,无分页进入下一篇,下面分享不修改源文件,只用JS的方法实现这样的效果,仅供参考
<script language="javascript" type="text/javascript">var shortname = "{dede:global.art_shortname/}";var npage = {dede:field name='nowpage'/};var totalpage = {dede:field name='totalpage'/};var namehand = '{dede:field name='namehand'/}';var displaytype = '{dede:field name='displaytype'/}';var gtimer = null;function pageOpenEnd(){ var nexturl = "{dede:prenext get='next' runphp="yes"}preg_match_all('/<a.*?(?: |//t|//r|//n)?href=[/'"]?(.+?)[/'"]?(?:(?: |//t|//r|//n)+.*?)?>(.+?)<//a.*?>/sim', @me, $strResult, PREG_PATTERN_ORDER);@me=$strResult[1][0];{/dede:prenext}"; if( nexturl != '' ){ window.location = nexturl; }else{ window.location="/"; }}//下一张function dPlayNext(){ if(npage==totalpage) { pageOpenEnd(); } else { if(displaytype=='st' && namehand!='') location.href = namehand+"_"+(npage+1)+shortname; else location.href = "view.php?aid={dede:field name='id'/}&pageno="+(npage+1); }}</script> |
新闻热点
疑难解答