視窗開啟後自動最大化,遮蔽工具欄
阿新 • • 發佈:2019-02-01
開啟一個沒有工具欄的最大化程式碼:
<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,"//遮蔽工具欄 +"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> 最大化程式碼如下: (寫於自本頁)
<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()">>
自本頁面程式碼:
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> 最大化程式碼如下:
<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()">>