js|分页|网页JS分页代码(BY AIRZEN modified 2004/05/13)
<Script Language="JavaScript" type="text/JavaScript" >
function showpage(url,num,c_p)
{
if (num<8)
{
stnum=num
}
else
{
stnum=8
}
for (i=1;i<=stnum;i++)
{
if (i==c_p){
document.write (i+" ");
}else{
document.write ("<a href='"+url+"&page="+i+"'>"+i+"</a>"+" ");
}
}
document.write ("..."+"<a href='"+url+"&page="+num+"'>"+num+"</a>"+" ");
}
</Script>
调用示例:
<Script Language="JavaScript" type="text/JavaScript" >
showpage("123.asp?id=5",10,5)
</Script>
<Script Language="JavaScript" type="text/JavaScript" >
showpage("123.asp?id=5",5,2)
</Script>
网页JS分页代码
80酷酷网 80kuku.com