html分页首页上一页下一页,HTML静态分页(形如:首页,上一页,下一页,尾页)...
在HTML中有時候我們會用到靜態分頁,一次拿回一定量的數據結果條目,我們會以形如:第2頁,共12頁??首頁 上一頁?下一頁?尾頁 的方式進行靜態分頁,以下是該種靜態分頁的代碼,供兄弟姐妹們參考。
function createPageHTML(_nPageCount, _nCurrIndex, _sPageName, _sPageExt){ ? if(_nPageCount == null || _nPageCount<1){ ??? return; ? } ? var nCurrIndex = _nCurrIndex || 0; ? var pre,next,first,last; ? if(_nPageCount==1){ ? first='首頁?'; pre='上一頁?'; next='下一頁?'; last='尾頁?'; }else{ ?if(_nCurrIndex==0){ ???? pre='上一頁?'; ???? first='首頁?'; next='下一頁?'; ???? last='尾頁?'; } else{ ?if(_nCurrIndex==1){ ?? first='首頁?'; pre='上一頁?'; ?? if(_nPageCount==2){ next='下一頁?'; last='尾頁?'; } else{ next='下一頁?'; last='尾頁?'; }} else{ ?? first='首頁?'; pre='上一頁?'; if(nCurrIndex+1==_nPageCount){ next='下一頁?'; last='尾頁?'; } else{ next='下一頁?'; last='尾頁?'; } }
}
}
document.write("第"+(nCurrIndex+1)+"頁,共"+_nPageCount+"頁??"+first+pre+next+last); }
createPageHTML(${PAGE_COUNT}, ${PAGE_INDEX}, "${PAGE_NAME}", "${PAGE_EXT}");??
總結
以上是生活随笔為你收集整理的html分页首页上一页下一页,HTML静态分页(形如:首页,上一页,下一页,尾页)...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 附近哪卖果木炭的?
- 下一篇: $(选择器).html,选择器.html