自己写的弹窗JS代码
function CPopWin(pWidth,pHeigth,pActionUrl,pAction,pIsBackPop,pDelaySeconds,pLeft,pTop){
this.Width=pWidth;
this.Heigth=pHeigth;
this.Action=pAction;
this.ActionUrl=pActionUrl;
this.DelaySeconds=pDelaySeconds;
this.Left=pLeft;
this.Top=pTop;
var othis=this;
this.DoPop=function(){
window.open(this.ActionUrl,"","titlebar=no,toolbar=no,menubar=no,dependent=yes,resizable =no,scrollbars=no,width="+this.Width+",height="+this.Heigth+" ,top="+this.Top+", left="+this.Left+",location=no, status=no");
if(pAction!=""){
window.setTimeout(this.Action,1);
}
if(pIsBackPop==true){
self.focus();
}
}
this.Pop=function(){
if(this.DelaySeconds<=0){
this.DoPop();
}else{
window.setTimeout(function(){othis.DoPop();},this.DelaySeconds*1000);
}
}
othis.Pop();
}
---------------------------------------------
使用时只需要 var c= CPopWin(pWidth,pHeigth,pActionUrl,pAction,pIsBackPop,pDelaySeconds,pLeft,pTop);即可
pWidth,pHeigth:=弹窗尺寸(像素)
pActionUrl:=弹窗URL
pAction:=弹窗弹出时需要做的动作,对应js的function名称,可以为""
pIsBackPop:=是否为背投弹窗,true为背投,false为前弹
pDelaySeconds:=在主窗口打开后延时多少秒后打开弹窗
pLeft,pTop:=弹窗弹出的左上角XY位置(像素)
this.Width=pWidth;
this.Heigth=pHeigth;
this.Action=pAction;
this.ActionUrl=pActionUrl;
this.DelaySeconds=pDelaySeconds;
this.Left=pLeft;
this.Top=pTop;
var othis=this;
this.DoPop=function(){
window.open(this.ActionUrl,"","titlebar=no,toolbar=no,menubar=no,dependent=yes,resizable =no,scrollbars=no,width="+this.Width+",height="+this.Heigth+" ,top="+this.Top+", left="+this.Left+",location=no, status=no");
if(pAction!=""){
window.setTimeout(this.Action,1);
}
if(pIsBackPop==true){
self.focus();
}
}
this.Pop=function(){
if(this.DelaySeconds<=0){
this.DoPop();
}else{
window.setTimeout(function(){othis.DoPop();},this.DelaySeconds*1000);
}
}
othis.Pop();
}
---------------------------------------------
使用时只需要 var c= CPopWin(pWidth,pHeigth,pActionUrl,pAction,pIsBackPop,pDelaySeconds,pLeft,pTop);即可
pWidth,pHeigth:=弹窗尺寸(像素)
pActionUrl:=弹窗URL
pAction:=弹窗弹出时需要做的动作,对应js的function名称,可以为""
pIsBackPop:=是否为背投弹窗,true为背投,false为前弹
pDelaySeconds:=在主窗口打开后延时多少秒后打开弹窗
pLeft,pTop:=弹窗弹出的左上角XY位置(像素)
爱东东
我的各类资源收集收集网站 http://tag.iddgame.com
我的实验性技术网站 http://www.iddgame.com
我的魔兽世界网站 http://www.iddwow.com.cn