网页自动全屏怎么实现?不通过空白跳转页?不通过按钮!
Posted by Ren Gang | Posted in Dreamweaver | Posted on 01-09-2010-05-2008
2
菜单是flash做的,现在需要全屏浏览所有页面,通过空白跳转页?不通过按钮!网页自动全屏怎么实现?【任刚的博客/问问 http://blog.rengang.org/ 】
常见的集中全屏代码都不是我的这种情况,谁会让所有asp页面自动全屏?而不是通过下面的html中的文本按钮点击实现全屏
最常见的是使用window.open的方法,直接打开全屏网页:
<script>
function fullwin(){
window.open(“rengang.blog,fullscreen.html”,”bfs”,”fullscreen,scrollbars”)
}
</script>
<center>
<form>
<input type=”button” onClick=”fullwin()” value=”Open Full Screen Window”>
</form>
</center>
另外,如果想让已经打开的网页全屏,有以下两种方法:
1.使用ActiveX
<script language=”JavaScript”>
function Fkey(){
var WsShell = new ActiveXObject(‘WScript.Shell’)
WsShell.SendKeys(‘{F11}’);
}
</script>
在body中写入全屏按钮
<a href=”javascript:Fkey()”>to full</a>
2.使用window.open模拟当前页:
<SCRIPT language=”JavaScript”>
function toFull(){
if(window.name==”fullscreen”)return;
var a =window.open(“rengang.blog,fullscreen.html”,”fullscreen”,”fullscreen=yes”)
a.location = window.location.href
window.opener=null
window.close()
}
</SCRIPT>
在body中写人按钮
<input type=button value=”full” onclick=toFull()>
