js實(shí)現(xiàn)ASP分頁(yè)函數(shù) HTML分頁(yè)函數(shù)
更新時(shí)間:2006年09月22日 00:00:00 作者:
復(fù)制代碼 代碼如下:
<!--
//ASP分頁(yè)函數(shù)
function ShowListPage(page,Pcount,TopicNum,maxperpage,strLink,ListName){
var alertcolor = '#FF0000';
maxperpage=Math.floor(maxperpage);
TopicNum=Math.floor(TopicNum);
page=Math.floor(page);
var n,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 ('<table border="0" cellpadding="0" cellspacing="1" class="Tableborder5">');
document.write ('<form method=post action="?pcount='+Pcount+strLink+'">');
document.write ('<tr align="center">');
document.write ('<td class="tabletitle1" title="'+ListName+'"> '+ListName+' </td>');
document.write ('<td class="tabletitle1" title="總數(shù)"> '+TopicNum+' </td>');
document.write ('<td class="tabletitle1" title="每頁(yè)"> '+maxperpage+' </td>');
document.write ('<td class="tabletitle1" title="頁(yè)次"> '+page+'/'+Pcount+'頁(yè) </td>');
if (page==1){
document.write ('<td class="tablebody1"> <font face=webdings>9</font> </td>');
}else{
document.write ('<td class="tablebody1"> <a href="?page=1'+strLink+'" title="首頁(yè)"><font face=webdings>9</font></a> </td>');
}
if (p*10 > 0){
document.write ('<td class="tablebody1"> <a href="?page='+p*10+strLink+'" title="上十頁(yè)"><font face=webdings>7</font></a> </td>');
}
if (page < 2){
document.write ('<td class="tablebody1"> 首 頁(yè) </td>');
document.write ('<td class="tablebody1"> 上一頁(yè) </td>');
}else{
document.write ('<td class="tablebody1"> <a href="?page=1'+strLink+'" title="首頁(yè)">首 頁(yè)</a> </td>');
document.write ('<td class="tablebody1"> <a href="?page='+(page-1)+strLink+'" title="上一頁(yè)">上一頁(yè)</a> </td>');
}
if (Pcount-page < 1){
document.write ('<td class="tablebody1"> 下一頁(yè) </td>');
document.write ('<td class="tablebody1"> 尾 頁(yè) </td>');
}else{
document.write ('<td class="tablebody1"> <a href="?page='+(page+1)+strLink+'" title="下一頁(yè)">下一頁(yè)</a> </td>');
document.write ('<td class="tablebody1"> <a href="?page='+Pcount+strLink+'" title="尾頁(yè)">尾 頁(yè)</a> </td>');
}
for (var i=p*10+1;i<p*10+11;i++){
if (i==n) break;
}
if (i<n){
document.write ('<td class="tablebody1"> <a href="?page='+i+strLink+'" title="下十頁(yè)"><font face=webdings>8</font></a> <td>');
}
if (page==n){
document.write ('<td class="tablebody1"> <Font face=webdings>:</font> </td>');
}else{
document.write ('<td class="tablebody1"> <a href="?page='+n+strLink+'" title="尾頁(yè)"><font face=webdings>:</font></a> </td>');
}
document.write ('<td class="tablebody1"><input class="PageInput" type=text name="page" size=1 maxlength=10 value="'+page+'"></td>');
document.write ('<td class="tablebody1"><input type=submit value=Go name=submit class="PageInput"></td>');
document.write ('</tr>');
document.write ('</form></table>');
}
//HTML分頁(yè)函數(shù)
function ShowHtmlPage(page,Pcount,TopicNum,maxperpage,strLink,ExtName,ListName){
var alertcolor = '#FF0000';
maxperpage=Math.floor(maxperpage);
TopicNum=Math.floor(TopicNum);
page=Math.floor(page);
var n,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 ('<table border="0" cellpadding="0" cellspacing="1" class="Tableborder5">');
document.write ('<form method=post>');
document.write ('<tr align="center">');
document.write ('<td class="tabletitle1" title="'+ListName+'"> '+ListName+' </td>');
document.write ('<td class="tabletitle1" title="總數(shù)"> '+TopicNum+' </td>');
document.write ('<td class="tabletitle1" title="每頁(yè)"> '+maxperpage+' </td>');
document.write ('<td class="tabletitle1" title="頁(yè)次"> '+page+'/'+Pcount+'頁(yè) </td>');
if (page==1){
document.write ('<td class="tablebody1"> <font face=webdings>9</font> </td>');
}else{
document.write ('<td class="tablebody1"> <a href="index'+ExtName+'" title="首頁(yè)"><font face=webdings>9</font></a> </td>');
}
if (p*10 > 0){
document.write ('<td class="tablebody1"> <a href="'+strLink+(p*10)+ExtName+'" title="上十頁(yè)"><font face=webdings>7</font></a> </td>');
}
if (page < 3){
document.write ('<td class="tablebody1"> 首 頁(yè) </td>');
document.write ('<td class="tablebody1"> <a href="index'+ExtName+'" title="上一頁(yè)">上一頁(yè)1</a> </td>');
}else{
document.write ('<td class="tablebody1"> <a href="index'+ExtName+'" title="首頁(yè)">首 頁(yè)1/a> </td>');
document.write ('<td class="tablebody1"> <a href="'+strLink+(page-1)+ExtName+'" title="上一頁(yè)">上一頁(yè)</a> </td>');
}
if (Pcount-page < 1){
document.write ('<td class="tablebody1"> 下一頁(yè)1 </td>');
document.write ('<td class="tablebody1"> 尾 頁(yè) </td>');
}else{
document.write ('<td class="tablebody1"> <a href="'+strLink+(page+1)+ExtName+'" title="下一頁(yè)">下一頁(yè)</a> </td>');
document.write ('<td class="tablebody1"> <a href="'+strLink+Pcount+ExtName+'" title="尾頁(yè)">尾 頁(yè)</a> </td>');
}
for (var i=p*10+1;i<p*10+11;i++){
if (i==n) break;
}
if (i<n){
document.write ('<td class="tablebody1"> <a href="'+strLink+i+ExtName+'" title="下十頁(yè)"><font face=webdings>8</font></a> <td>');
}
if (page==n){
document.write ('<td class="tablebody1"> <Font face=webdings>:</font> </td>');
}else{
document.write ('<td class="tablebody1"> <a href="'+strLink+n+ExtName+'" title="尾頁(yè)"><font face=webdings>:</font></a> </td>');
}
//document.write ('<td class="tabletitle1" title="轉(zhuǎn)到"> GO </td>');
document.write ('<td class="tablebody1"><select class="PageInput" name="page" size="1" onchange="javascript:window.location=this.options[this.selectedIndex].value;">');
document.write ('<option value="index'+ExtName+'">第1頁(yè)</option>');
for (var i=2;i<TopicNum;i++){
if (i==page){
document.write ('<option value="'+strLink+i+ExtName+'" selected>第'+i+'頁(yè)</option>');
}else{
if (i==1){
document.write ('<option value="index'+ExtName+'">第1頁(yè)</option>');
}else{
document.write ('<option value="'+strLink+i+ExtName+'">第'+i+'頁(yè)</option>');
}
}
if (i==n) break;
}
document.write ('</select></td>');
document.write ('</tr>');
document.write ('</form></table>');
}
//-->
您可能感興趣的文章:
- asp下計(jì)算分頁(yè)的幾種方法
- ASP分頁(yè)類(支持多風(fēng)格變換)
- 透徹掌握ASP分頁(yè)技術(shù)很詳細(xì)的分析
- asp分頁(yè)(自己整理的2個(gè)分頁(yè)程序)
- 易心asp分頁(yè)類 v1.0
- asp分頁(yè)生成html的程序腳本代碼
- 徹底掌握ASP分頁(yè)技術(shù)雜談
- asp分頁(yè)的一個(gè)類
- 簡(jiǎn)單的ASP分頁(yè)代碼(測(cè)試正確)
- flash和asp分頁(yè)的一點(diǎn)心得與flash腳本
- 葉子asp分頁(yè)類
- ASP分頁(yè)時(shí)計(jì)算頁(yè)面總數(shù)的幾種算法小結(jié)
相關(guān)文章
Prototype 1.5.0_rc1 及 Prototype 1.5.0 Pre0小抄本
Prototype 1.5.0_rc1 及 Prototype 1.5.0 Pre0小抄本...2006-09-09silverlight線程與基于事件驅(qū)動(dòng)javascript引擎(實(shí)現(xiàn)軌跡回放功能)
前一段時(shí)間一直在重構(gòu)工作站軌跡回放功能,一開(kāi)始我覺(jué)得很簡(jiǎn)單,但是后面引發(fā)了一系列奇怪的問(wèn)題,讓我很疼,所以不得不寫個(gè)總結(jié)加深記憶,2011-08-08layui點(diǎn)擊數(shù)據(jù)表格添加或刪除一行的例子
今天小編就為大家分享一篇layui點(diǎn)擊數(shù)據(jù)表格添加或刪除一行的例子,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-09-09JQuery+DIV自定義滾動(dòng)條樣式的具體實(shí)現(xiàn)
用DIV和DIV自身的滾動(dòng)條相互控制內(nèi)容的滾動(dòng),DIV自身的滾動(dòng)條樣式可以用DIV層覆蓋,重寫滾動(dòng)條樣式2013-06-06淺談js繼承的實(shí)現(xiàn)及公有、私有、靜態(tài)方法的書寫
下面小編就為大家?guī)?lái)一篇淺談js繼承的實(shí)現(xiàn)及公有、私有、靜態(tài)方法的書寫。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-10-10javaScript實(shí)現(xiàn)支付10秒倒計(jì)時(shí)
這篇文章主要為大家詳細(xì)介紹了javaScript實(shí)現(xiàn)支付10秒倒計(jì)時(shí),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-10-10用原生JS對(duì)AJAX做簡(jiǎn)單封裝的實(shí)例代碼
下面小編就為大家?guī)?lái)一篇用原生JS對(duì)AJAX做簡(jiǎn)單封裝的實(shí)例代碼。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-07-07js下劃線和駝峰互相轉(zhuǎn)換的實(shí)現(xiàn)(多種方法)
本文主要介紹了js下劃線和駝峰互相轉(zhuǎn)換的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-10-10