时间:2021-05-26
复制代码 代码如下:
<!--
//ASP分页函数
functionShowListPage(page,Pcount,TopicNum,maxperpage,strLink,ListName){
varalertcolor='#FF0000';
maxperpage=Math.floor(maxperpage);
TopicNum=Math.floor(TopicNum);
page=Math.floor(page);
varn,p;
if((page-1)%10==0){
p=(page-1)/10
}else{
p=(((page-1)-(page-1)%10)/10)
}
if(TopicNum%maxperpage==0){
n=TopicNum/maxperpage;
}else{
n=(TopicNum-TopicNum%maxperpage)/maxperpage+1;
}
document.write('<tableborder="0"cellpadding="0"cellspacing="1"class="Tableborder5">');
document.write('<formmethod=postaction="?pcount='+Pcount+strLink+'">');
document.write('<tralign="center">');
document.write('<tdclass="tabletitle1"title="'+ListName+'"> '+ListName+' </td>');
document.write('<tdclass="tabletitle1"title="总数"> '+TopicNum+' </td>');
document.write('<tdclass="tabletitle1"title="每页"> '+maxperpage+' </td>');
document.write('<tdclass="tabletitle1"title="页次"> '+page+'/'+Pcount+'页 </td>');
if(page==1){
document.write('<tdclass="tablebody1"> <fontface=webdings>9</font> </td>');
}else{
document.write('<tdclass="tablebody1"> <ahref="?page=1'+strLink+'"title="首页"><fontface=webdings>9</font></a> </td>');
}
if(p*10>0){
document.write('<tdclass="tablebody1"> <ahref="?page='+p*10+strLink+'"title="上十页"><fontface=webdings>7</font></a> </td>');
}
if(page<2){
document.write('<tdclass="tablebody1"> 首页 </td>');
document.write('<tdclass="tablebody1"> 上一页 </td>');
}else{
document.write('<tdclass="tablebody1"> <ahref="?page=1'+strLink+'"title="首页">首页</a> </td>');
document.write('<tdclass="tablebody1"> <ahref="?page='+(page-1)+strLink+'"title="上一页">上一页</a> </td>');
}
if(Pcount-page<1){
document.write('<tdclass="tablebody1"> 下一页 </td>');
document.write('<tdclass="tablebody1"> 尾页 </td>');
}else{
document.write('<tdclass="tablebody1"> <ahref="?page='+(page+1)+strLink+'"title="下一页">下一页</a> </td>');
document.write('<tdclass="tablebody1"> <ahref="?page='+Pcount+strLink+'"title="尾页">尾页</a> </td>');
}
for(vari=p*10+1;i<p*10+11;i++){
if(i==n)break;
}
if(i<n){
document.write('<tdclass="tablebody1"> <ahref="?page='+i+strLink+'"title="下十页"><fontface=webdings>8</font></a> <td>');
}
if(page==n){
document.write('<tdclass="tablebody1"> <Fontface=webdings>:</font> </td>');
}else{
document.write('<tdclass="tablebody1"> <ahref="?page='+n+strLink+'"title="尾页"><fontface=webdings>:</font></a> </td>');
}
document.write('<tdclass="tablebody1"><inputclass="PageInput"type=textname="page"size=1maxlength=10value="'+page+'"></td>');
document.write('<tdclass="tablebody1"><inputtype=submitvalue=Goname=submitclass="PageInput"></td>');
document.write('</tr>');
document.write('</form></table>');
}
//HTML分页函数
functionShowHtmlPage(page,Pcount,TopicNum,maxperpage,strLink,ExtName,ListName){
varalertcolor='#FF0000';
maxperpage=Math.floor(maxperpage);
TopicNum=Math.floor(TopicNum);
page=Math.floor(page);
varn,p;
if((page-1)%10==0){
p=(page-1)/10
}else{
p=(((page-1)-(page-1)%10)/10)
}
if(TopicNum%maxperpage==0){
n=TopicNum/maxperpage;
}else{
n=(TopicNum-TopicNum%maxperpage)/maxperpage+1;
}
document.write('<tableborder="0"cellpadding="0"cellspacing="1"class="Tableborder5">');
document.write('<formmethod=post>');
document.write('<tralign="center">');
document.write('<tdclass="tabletitle1"title="'+ListName+'"> '+ListName+' </td>');
document.write('<tdclass="tabletitle1"title="总数"> '+TopicNum+' </td>');
document.write('<tdclass="tabletitle1"title="每页"> '+maxperpage+' </td>');
document.write('<tdclass="tabletitle1"title="页次"> '+page+'/'+Pcount+'页 </td>');
if(page==1){
document.write('<tdclass="tablebody1"> <fontface=webdings>9</font> </td>');
}else{
document.write('<tdclass="tablebody1"> <ahref="index'+ExtName+'"title="首页"><fontface=webdings>9</font></a> </td>');
}
if(p*10>0){
document.write('<tdclass="tablebody1"> <ahref="'+strLink+(p*10)+ExtName+'"title="上十页"><fontface=webdings>7</font></a> </td>');
}
if(page<3){
document.write('<tdclass="tablebody1"> 首页 </td>');
document.write('<tdclass="tablebody1"> <ahref="index'+ExtName+'"title="上一页">上一页1</a> </td>');
}else{
document.write('<tdclass="tablebody1"> <ahref="index'+ExtName+'"title="首页">首页1/a> </td>');
document.write('<tdclass="tablebody1"> <ahref="'+strLink+(page-1)+ExtName+'"title="上一页">上一页</a> </td>');
}
if(Pcount-page<1){
document.write('<tdclass="tablebody1"> 下一页1 </td>');
document.write('<tdclass="tablebody1"> 尾页 </td>');
}else{
document.write('<tdclass="tablebody1"> <ahref="'+strLink+(page+1)+ExtName+'"title="下一页">下一页</a> </td>');
document.write('<tdclass="tablebody1"> <ahref="'+strLink+Pcount+ExtName+'"title="尾页">尾页</a> </td>');
}
for(vari=p*10+1;i<p*10+11;i++){
if(i==n)break;
}
if(i<n){
document.write('<tdclass="tablebody1"> <ahref="'+strLink+i+ExtName+'"title="下十页"><fontface=webdings>8</font></a> <td>');
}
if(page==n){
document.write('<tdclass="tablebody1"> <Fontface=webdings>:</font> </td>');
}else{
document.write('<tdclass="tablebody1"> <ahref="'+strLink+n+ExtName+'"title="尾页"><fontface=webdings>:</font></a> </td>');
}
//document.write('<tdclass="tabletitle1"title="转到"> GO </td>');
document.write('<tdclass="tablebody1"><selectclass="PageInput"name="page"size="1"onchange="javascript:window.location=this.options[this.selectedIndex].value;">');
document.write('<optionvalue="index'+ExtName+'">第1页</option>');
for(vari=2;i<TopicNum;i++){
if(i==page){
document.write('<optionvalue="'+strLink+i+ExtName+'"selected>第'+i+'页</option>');
}else{
if(i==1){
document.write('<optionvalue="index'+ExtName+'">第1页</option>');
}else{
document.write('<optionvalue="'+strLink+i+ExtName+'">第'+i+'页</option>');
}
}
if(i==n)break;
}
document.write('</select></td>');
document.write('</tr>');
document.write('</form></table>');
}
//-->
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
本文实例讲述了JS基于封装函数实现的表格分页。分享给大家供大家参考,具体如下:HTML代码:www.jb51.netjs表格分页#idData{color:re
分享一例php分页函数代码,用此函数实现分页代码很不错。代码,php分页函数。复制代码代码如下:
BootstrapPaginator分页插件下载地址:DownloadVisitProjectinGitHub1.这是需要分页的页面放的js函数:functio
本文实例讲述了PHP实现仿Google分页效果的分页函数。分享给大家供大家参考。具体如下:/***分页函数*@paramint$total总页数*@parami
使用bootstrap-paginator.js分页来进行ajax异步分页请求具体的做法如下:首先定义一个异步提交请求的ajax函数,其完整的函数如下:varn