var innerpage,pagehtml,thecontent,a_thecontent; var currentpage=0; var pagecount=0; var p=6; //表示开始时显示的页码总数 var m=3; //超过p页后左右两边显示页码数 var lastpage; function build_innerpage() { pagehtml=""; if(currentpagepagecount) { lastpage=pagecount; } for(i=1;i<=lastpage;i++) { if(currentpage==i) { pagehtml+=" "+i+""; } else { pagehtml+=" "+i+""; } } } else { lastpage=currentpage+m; if(lastpage>pagecount) { lastpage=pagecount; } for(i=currentpage-m;i<=lastpage;i++) { if(currentpage==i) { pagehtml+=" "+i+""; } else { pagehtml+=" "+i+""; } } } if(currentpage>1) { pagehtml=" 首页 上一页"+pagehtml; } if(currentpage>=1 && currentpage下一页 尾页"; } innerpage.innerhtml=pagehtml+" 页次:"+currentpage+"/"+pagecount+""; } function page(j) { currentpage=j; document.documentelement.scrolltop=0; contentobj.innerhtml=a_thecontent[currentpage-1]; build_innerpage(); } var contentobj=document.getelementbyid("content"); if(contentobj!=null) { thecontent=contentobj.innerhtml; //a_thecontent=thecontent.split(/
 <\/span><\/div>/i); a_thecontent=thecontent.split(/]*page-break-after[^>]*>/i); // if (object.hasownproperty.call(window, "activexobject") && !window.activexobject) //{ // a_thecontent=thecontent.split(//i); //} //else //{ //a_thecontent=thecontent.split(//i); //} pagecount=a_thecontent.length; if(pagecount>1) { document.write('
'); innerpage=document.getelementbyid("contentinnerpage"); page(1); } }