| 上一页"); else if(countPage>1&¤tPage!=0&¤tPage==1) document.write(" | 首页 | 上一页"); else document.write(" | 首页 | 上一页"); //循环 var num = 8; for(var i=0+(currentPage-1-(currentPage-1)%num) ; i<=(num+(currentPage-1-(currentPage-1)%num))&&(i | "+1+"");} else document.write(" | "+(i+1)+""); } //设置下一页代码 if(countPage>1&¤tPage!=(countPage-1)) document.write(" | 下一页 | 末页"); else document.write(" | 下一页 | 末页"); document.write(" | 总共"+countPage+"页"); //跳转页面 document.write("转到第页"+ " "); function toPage(){ var _num = document.getElementById("num").value; var str = "index"+"_"+(_num-1)+"."+"html"; var url = location.href.substring(0,location.href.lastIndexOf("/")+1); if(_num<=1||_num==null) location.href = url+"index"+"."+"html"; else if(_num>countPage) alert("本频道最多"+countPage+"页"); else location.href = url+str; } |