叶子asp分页类(7)


}
//输入 语言 下页
Cls_jsPage.prototype.setPageNext=function(sDis,sEn){
 this.PN_D=sDis;
 this.PN_E=sEn;
}
//输入 语言 尾页
Cls_jsPage.prototype.setPageLast=function(sDis,sEn){
 this.PL_D=sDis;
 this.PL_E=sEn;
}
//输入 语言 数字跳转
Cls_jsPage.prototype.setPageText=function(sDis,sEn){
 this.PT_D=sDis;//"[{$PageNum}]"
 this.PT_E=sEn;//"第{$PageNum}页"
}
//输入 语言 数字跳转外围模板
Cls_jsPage.prototype.setPageTextF=function(sDis,sEn){
 this.PTF_D=sDis;//" {$PageTextF} "
 this.PTF_E=sEn;//" {$PageTextF} "
}
//输入 语言 下拉菜单跳转
Cls_jsPage.prototype.setPageSelect=function(sDis,sEn){
 this.PS_D=sDis;//"[{$PageNum}]"
 this.PS_E=sEn;//"第{$PageNum}页"
}
//输入 css
Cls_jsPage.prototype.setPageCss=function(sCssPageText,sCssPageInput,sCssPageSelect){
 this.CPT=sCssPageText;//数字跳转css
 this.CPI=sCssPageInput;//输入框跳转css
 this.CPS=sCssPageSelect;//下拉菜单跳转css
}
//输入 Html模板
Cls_jsPage.prototype.setHtml=function(sHtml){
 this.Html=sHtml;//Html模板
}
//计算页数
Cls_jsPage.prototype.getPageCount=function(){
 var iRC=this.iRC,iPS=this.iPS;
 var i=(iRC%iPS==0)?(iRC/iPS):(this.FormatNum((iRC/iPS),1,0,0,0)+1);
 return (i);
}
//取得模板页数和当前页数
Cls_jsPage.prototype.getUrl=function(iType){
 var s=this.Url,sPS=this.sPS,sPE=this.sPE,sTP=this.sTPage,iPC=this.iPC;
 var iT=iType,i;
 if (s.indexOf(sPS)==-1) { 
  s+=((s.indexOf("?")==-1)?"?":"&")+sPS+sTP;
  i=1;
 }
 else {
  sReg="(\\S.*)"+this.FormatReg(sPS)+"(\\d*)"+this.FormatReg(sPE)+"(\\S.*|\\S*)";
  var sPIndex=this.Reg(s,sReg,"$3");
  s=s.replace(sPS+sPIndex+sPE,sPS+sTP+sPE);
  i=this.FormatNum(sPIndex,1,1,0,iPC);
 }
 s=this.Reg(s,"(&+)","&");
 s=this.Reg(s,"(\\?&)","?");
 return (iT==0?s:i);
}
//页面跳转
Cls_jsPage.prototype.PageJump=function(){
 var sPL,sPV,sP;
 var sU=this.getUrl(0),iPI=this.getUrl(1);
 var sPI=this.sPI,sTP=this.sTPage,iPC=this.iPC;
 sPL=document.getElementsByName(sPI).length;
 for (var i=0;i<sPL;i++) {
  sPV=document.getElementsByName(sPI)[i].value;
  sP=this.FormatNum(sPV,1,1,0,iPC);
  if (sP>0) {
   location.href=sU.replace(sTP,sP);
   break;
  }
 }
}
//输出
Cls_jsPage.prototype.Write=function(){
 var sU=this.getUrl(0),iPI=this.getUrl(1);
 var sN=this.sN,sPI=this.sPI;

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3454.html