窗口打开后自动最大化,屏蔽工具栏
打开一个没有工具栏的最大化代码:
<SCRIPT language="JavaScript">
function toFull(){
window.open("[目标页名]","[标题]","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+screen.availWidth",height="+screen.availHeight+",top=0,left=0")
}
</SCRIPT>
<input type=button value="New Window" onClick="toFull()">
自本页面代码: (写于自本页)
自本页面代码: (写于自本页)
<SCRIPT language="JavaScript">
function toFull(){
if(window.name=="fullscreen")return;
var a =window.open("","fullscreen","toolbar=no,"//屏蔽工具栏
function toFull(){
if(window.name=="fullscreen")return;
var a =window.open("","fullscreen","toolbar=no,"//屏蔽工具栏
+"location=no,"//地址栏
+"directories=no,"//
+"status=no,"//状态栏
+"menubar=no,"//菜单栏
+"scrollbars=yes,"//滚动条
+"resizable=no,"//大小可变
+"width=800,"//宽,最大可取+"width="+screen.availWidth","
+"height=600,"//高,最大可取+"height="+screen.availHeight+","
+"top="+((screen.height-600)/2)//顶点坐标top,最大化时取0
+",left="+((screen.width-800)/2)) //顶点坐标left,最大化时取0
a.location = window.location.href
window.opener=null
window.close()
}
toFull();
</SCRIPT>
a.location = window.location.href
window.opener=null
window.close()
}
toFull();
</SCRIPT>
最大化代码如下: (写于自本页)
<script language="JavaScript">
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
</script>
纯html页面还可以使用以下代码:
<OBJECT id="max" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM name="Command" value="Maximize"></OBJECT>
<BODY onload="if(document.body.offsetWidth<screen.width)max.Click()">>
<script language="JavaScript">
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
</script>
纯html页面还可以使用以下代码:
<OBJECT id="max" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM name="Command" value="Maximize"></OBJECT>
<BODY onload="if(document.body.offsetWidth<screen.width)max.Click()">>