官方那个下拉菜单太不友好了,页数多了,代码还多,还不方便
网上搜到一段代码,我已经修改好了——你懂的!
一定要留住 form 表单
<script language="javascript"> <!-- function onCheckPage(){ var beginPage = parseInt(document.beginPagefrm.beginPage.value); if(isNaN(beginPage)){ alert("请输入数字!"); return false; } if(beginPage <= 0 ) { beginPage = 1; } if(beginPage > 100){ beginPage = 100; } if(beginPage > 1 ) { document.beginPagefrm.action = "list_{dede:field name='typeid'/}_" + beginPage + ".html"; } else { document.beginPagefrm.action = "{dede:type typeid=’0′ row=1}[field:typelink /]{/dede:type}"; } return true; } --> </script> |
<div class="dede_pages"> <ul class="pagelist"> <form name="beginPagefrm" method=post action="" *****ubmit="return onCheckPage()"> {dede:pagelist listitem="index,end,pre,next,pageno" listsize="5"/}直接到第<input size=4 name="beginPage" value="">页<input type="submit" name="Submit" value="前住"> </form> </ul> </div> |
原文链接:https://www.f2er.com/dedecms/533326.html