程序代碼如下:
這段程序放在<body>與</body>之間
<script>
<!--
function windowopen(){
var target="http://zhoucaiqi.51.net"
newwindow=window.open("","","scrollbars")
if (document.all){
newwindow.moveTo(0,0)
newwindow.resizeTo(screen.width,screen.height)
}
newwindow.location=target
}
//-->
</script>
<form>
<input type="button" onClick="windowopen()" value="全屏顯示" name="button">
</form>
程序講解:
function windowopen()
|
定義一個函數。 |
{ var target="http://zhoucaiqi.51.net"
|
設置一個字符串。 |
newwindow=window.open("","","
scrollbars")
|
打開一個新窗口。 |
if (document.all)
{ newwindow.moveTo(0,0)
|
新窗口從(0,0)位置開始顯示。 |
newwindow.resizeTo
(screen.width,screen.height) }
|
新窗口的尺寸是整個屏幕的寬,整個屏幕的高。 |
newwindow.location=target |
顯示target指定的鏈接地址。 |
<input type="button" onClick="windowopen()" value="全屏顯示"
name="button"> |
插入一個按鈕,擊它的時候調用windowopen()函數。 |
|
|