爱东东

VS.NET,IT,个人,个人网站 爱东东 http://www.idongdong.net

 

自己写的弹窗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位置(像素)

posted on 2006-06-30 10:57  爱东东  阅读(1068)  评论(0编辑  收藏  举报

导航