分页跳转按钮:
<script> $(function(){ $(‘#public_ym_left‘).live(‘click‘,function(){ //<符号的右侧的第一个号 var sibQ=$(‘#public_ym_left‘).next().text(); if(sibQ>=1&&sibQ<=5) var start=1; if(sibQ>5) var start=parseInt(sibQ)-4; $("#upage").children().remove(); var childQ=$(‘<li id="public_ym_left"><a href=\‘#\‘" /a></li>‘); var childH=$(‘<li id="public_ym_right"><a href=\‘#\‘" /a></li>‘); var loage=$(‘<li><a href=\‘#\‘" /a></li>‘); $("#upage").append(childQ); for(var i=start;i<(start+5);i++) { var son=$(‘<li><a class="vpage" id="page‘+i+‘" href=\‘#\‘" /a></li>‘); $("#upage").append(son); } $("#upage").append(loage); $("#upage").append(childH); $(‘#public_ym_left‘).unbind(); }); $(‘#public_ym_right‘).live(‘click‘,function(){ var sibH=$(‘#public_ym_right‘).prev().prev().text(); var start=parseInt(sibH); $("#upage").children().remove(); var childQ=$(‘<li id="public_ym_left"><a href=\‘#\‘" /a></li>‘); var childH=$(‘<li id="public_ym_right"><a href=\‘#\‘" /a></li>‘); var loage=$(‘<li><a href=\‘#\‘" /a></li>‘); $("#upage").append(childQ); for(var i=start;i<(parseInt(start)+5);i++) { var son=$(‘<li><a class="vpage" id="page‘+i+‘" href=\‘#\‘" /a></li>‘); $("#upage").append(son); } $("#upage").append(loage); $("#upage").append(childH); $(‘#public_ym_right‘).unbind(); }); }); </script>
<div class="public_ym"> <ul id="upage"> <li id="public_ym_left"><a href=\‘#\‘" ></a></li> <li class="vpage"><a id="page1" class="vpage" href=\‘#\‘" /a></li> <li class="vpage" ><a id="page2" class="vpage" href=\‘#\‘" /a></li> <li class="vpage"><a id="page3" class="vpage" href=\‘#\‘" /a></li> <li class="vpage" ><a id="page4" class="vpage" href=\‘#\‘" /a></li> <li class="vpage" ><a id="page5" class="vpage" href=\‘#\‘" /a></li> <li><a href=\‘#\‘" /a></li> <li id="public_ym_right"><a href=\‘#\‘" /a></li> </ul> <table border="0" cellpadding="0" cellspacing="0" class="public_tzy"> <tr> <td width="64" align="right">跳转到第</td> <td width="57" align="center"><input name="" type="text" class="ym_tzys" /></td> <td width="59">共<span>100</span>页</td> </tr> </table> </div>
本文出自 “王尼美的成人之路” 博客,请务必保留此出处http://8335914.blog.51cto.com/8325914/1362796