//导航显示样式 0:常规 1:直接 2:下拉 //var ShowStyle = 1; //语言,如果是en使用英文 var lang = ''; //每页显示字数 //var perpageLength = 10; //分页模式 1:根据字数自动分页 2:根据分页 //var flag=2; var PageNum; if(window.navigator.userAgent.toLowerCase().indexOf("firefox")>0){ //firefox innerText define HTMLElement.prototype.__defineGetter__( "innerText", function(){ var anyString = ""; var childS = this.childNodes; for(var i=0; i 0) { PageNum[j]=sFlag+PageNum[j-1]+10; } else{ PageNum[j]=contentLength; } j+=1; } while (PageNum[j-1]")>0 { strDisplayContent=content; //console.log(strDisplayContent); divDisplayContent.innerHTML=strDisplayContent; return null; } pageSizeCount=Math.ceil((contenttextLength/perpageLength)); } DHTMLpagenation.goto(currentPage); DHTMLpagenation.displayContent(); }}; DHTMLpagenation.displayPage=function() { with (this) { //分页码显示函数 //参数为调用样式,0=简单样式,1=标准样式 var temp=""; if (ShowStyle==0) //简单样式 { tempPage=currentPage; if(contentLength>perpageLength){ if (currentPage-4<=1){ temp=temp+"9"; if (currentPage<=1){temp=temp+"7";}else{temp=temp+"7 ";} if (pageSizeCount>10){ for(i=1;i<8;i++){ if (i==currentPage){ temp=temp+""+i+" "; }else{ temp=temp+""+i+""+" "; } } temp=temp+" ..."; } else{ for(i=1;i"+i+" "; } else{ temp=temp+""+i+""+" "; } } } if (currentPage==pageSizeCount){temp=temp+"8";}else{temp=temp+"8 ";} if(pageSizeCount<10){temp=temp+":";}else{temp=temp+": ";} } else if(currentPage+4<=pageSizeCount){ temp=temp+"9 "; temp=temp+"7 "; if (pageSizeCount>10){ temp=temp+".."; for(i=currentPage-4;i"+i+" "; } else{ temp=temp+""+i+""+" "; } } temp=temp+" .."; } else{ for(i=1;i"+i+" "; } else{ temp=temp+""+i+""+" "; } } } if (currentPage==pageSizeCount){temp=temp+"8";}else{temp=temp+"8 ";} temp=temp+": "; } else{ temp=temp+"9 "; temp=temp+"7 "; temp=temp+".." for(i=currentPage-2;i"+i+" "; } else{ temp=temp+""+i+""+" "; } } if (currentPage==pageSizeCount){temp=temp+"8";}else{temp=temp+"8 ";} temp=temp+":"; } } else{ temp=temp+"1 "; } temp=temp+" "+((lang=='en' || lang==2)?'Show All':'显示全部')+" " temp=temp+"" } else if (ShowStyle==1) //标准样式 { if(contentLength>perpageLength){if(currentPage!=0){if(currentPage!=1){temp=temp+"[上一页]  ";}}} for (i=1;i["+i+"]  "; } else{ temp=temp+"["+i+"]  "; } } temp=temp+""; if(contentLength>perpageLength){if(currentPage!=0){if(currentPage!=pageSizeCount){temp=temp+"[下一页]  ";}}} temp=temp+" "+((lang=='en' || lang==2)?'Show All':'显示全部')+"" } else if (ShowStyle==2) //下拉菜单样式 { temp=temp+'"; } //divDisplayPagenation.innerHTML=temp; return temp; }}; DHTMLpagenation.previous=function() { with(this) { DHTMLpagenation.goto(currentPage-1); }}; DHTMLpagenation.next=function() { with(this) { DHTMLpagenation.goto(currentPage+1); }}; DHTMLpagenation.goto=function(iCurrentPage) { with (this) { startime=new Date(); if(iCurrentPage==0){ currentPage = 0; strDisplayContent = content; } else if(flag==2) { currentPage=iCurrentPage; strDisplayContent=content.substring(PageNum[iCurrentPage-1]+10,PageNum[iCurrentPage]); } else if(regularExp.test(iCurrentPage)) { currentPage=iCurrentPage; //strDisplayContent=content.substr((currentPage-1)*perpageLength,perpageLength); if(!arr){ var textnum = 0; var textstr = ""; var pagenum = 1; var startcount = true; var arr = new Array(); for (var i = 0; i < content.length; i++) { textstr += content[i]; if(content[i]=="<") startcount = false; else if(content[i]==">"){ startcount = true; continue; } if(!startcount) continue; textnum++; //console.log(textstr.substr(textstr.length-4,2)); if(textnum>=perpageLength){//&&textstr.substr(textstr.length-4,2)=="0 //console.log(textstr.indexOf("" + strDisplayContent + "
"; DHTMLpagenation.displayContent(); $("div.block_news").height("auto");setDivHeight("#container"); }}; DHTMLpagenation.displayContent=function() { with (this) { divDisplayContent.innerHTML=strDisplayContent; }}; DHTMLpagenation.change=function(iPerpageLength) { with(this) { if(regularExp.test(iPerpageLength)) { DHTMLpagenation.perpageLength=iPerpageLength; DHTMLpagenation.currentPage=1; DHTMLpagenation.initialize(); } else { alert("请输入数字"); } }};