使弹出窗口最大化的JS代码

方法1:在父窗口实现

<script language="javascript">window.open("default.aspx", "page1", "width=" + screen.width + ",height=" + screen.height + ",top=0,left=0,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,status=yes");</script>

如果要满屏,加上一个 fullscreen=yes

 

方法2:在子窗口实现

<body onload="javascript:init()">

<script language="JavaScript">

function init(){
self.moveTo(0, 0);
self.resizeTo(screen.availwidth, screen.availheight);}
</script>

你可能感兴趣的:(弹出窗口)