js控制网页全屏显示

这段程序放在<body>与</body>之间
<script>
<!--
function windowopen(){
var target="http://play.zol.com.cn"
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">
posted @ 2010-07-27 12:07  你妹的sb  阅读(5776)  评论(1编辑  收藏  举报
百度一下