`

window.showModalDialog与window.open

    博客分类:
  • web
阅读更多

//window.showModalDialog全屏显示

function winModalFullScreen(strURL)
{

 var sheight = screen.height-70;

 var swidth = screen.width-10;

 var winoption ="dialogHeight:"+sheight+"px;dialogWidth:"+ swidth  

+"px;status:yes;scroll:yes;resizable:yes;center:yes";


 var tmp=window.showModalDialog(strURL,window,winoption);

 return tmp;

}

 

//window.open全屏显示

function winOpenFullScreen(strURL)
{

 var sheight = screen.height-70;

 var swidth = screen.width-10;

 var winoption ="left=0,top=0,height="+sheight+",width="+swidth 

+",toolbar=yes,menubar=yes,location=yes,status=yes,scrollbars=yes,resizable=yes";

 
var tmp=window.open(strURL,'',winoption);

 return tmp;

}

 

1.    dialogHeight:    对话框高度,不小于100px
2.    dialogWidth:    对话框宽度。
3.    dialogLeft:     离屏幕左的距离。
4.    dialogTop:     离屏幕上的距离。
5.    center:          { yes | no | 1 | 0 } :              是否居中,默认yes,但仍可以指

定高度和宽度。
6.    help:             {yes | no | 1 | 0 }:                是否显示帮助按钮,默认yes。
7.    resizable:       {yes | no | 1 | 0 } [IE5+]:     是否可被改变大小。默认no。
8.    status:          {yes | no | 1 | 0 } [IE5+]:      是否显示状态栏。默认为yes[

Modeless]或no[Modal]。
9.    scroll:            { yes | no | 1 | 0 | on | off }:是否显示滚动条。默认为yes。

 

window.open方式父级页面获取子级页面的返回值
function check() {
          window.opener.document.getElementById("txtId").value=id;
          window.opener.document.getElementById("txtName").value=name;
  }
 
  这样,父级页面的document.getElementById("txtId") 和

document.getElementById("txtName") 2个控件就可以得到子级页面的返回值。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics