经典分页脚本:
[CODE]<script language="javascript">
<!--
function ShowPageLink(sUrl,iPage,iCount){
var i;
i=Math.max(1,iPage-1);
if(iPage==1){
document.write("<span style='color:#7d7d7d'><font face=Webdings>9</font></span> ");
document.write("<span style='color:#7d7d7d'><font face=Webdings>7</font></span> ");
}
else{
document.write("<a href=\"" + sUrl + "1\" title='第 1 页'><font face=Webdings>9</font></a> ");
document.write("<a href=\"" + sUrl + i + "\" title='上一页(第 " + i + " 页)'><font face=Webdings>7</font></a> ");
}
if(iPage>6) document.write("<span style='font-size:8px'>···</span> ");
for(i=Math.max(1,iPage-5);i<iPage;i++){
document.write("<a href=\""+sUrl + i + "\" title='第 " + i + " 页'><b>" + i + "</b></a> ");
}
document.write("<font color='#ff3333'><b>" + iPage + "</b></font> ");
for(i=iPage+1;i<=Math.min(iCount,iPage+5);i++){
document.write("<a href=\""+sUrl + i + "\" title='第 " + i + " 页'><b>" + i + "</b></a> ");
}
i=Math.min(iCount,iPage+1);
if(iCount>iPage+5) document.write("<span style='font-size:8px'>···</span> ");
if(iPage==iCount){
document.write("<span style='color:#7d7d7d'><font face=Webdings>8</font></span> ");
document.write("<span style='color:#7d7d7d'><font face=Webdings>:</font></span> ");
}
else{
document.write("<a href=\"" + sUrl + i + "\" title='下一页(第 " + i + " 页)'><font face=Webdings>8</font></a> ");
document.write("<a href=\"" + sUrl + iCount + "\" title='最后一页(第 " + iCount + " 页)'><font face=Webdings>:</font></a> ");
}
}
ShowPageLink("<%=SelfName%>?page=",<%=sPage%>,<%=mPage%>);
//-->
</script>[/CODE]
只要你给出当前URL(<%=SelfName%>),当前页(<%=sPage%>) 和最大页(<%=mPage%>)就搞定了
这样的分页很美观很灵活!!