js——网页全屏显示

程序代码如下:

这段程序放在<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()函数。

posted on 2009-04-16 13:44 胡鹏 阅读(9205) 评论(0)  编辑  收藏 所属分类: js,html,css


只有注册用户登录后才能发表评论。


网站导航:
 

导航

<2009年4月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

统计

常用链接

留言簿(3)

随笔分类

随笔档案

agile

搜索

最新评论

阅读排行榜

评论排行榜