用javascript实现强制网页全屏
来源:互联网 发布:哈工大大数据 编辑:程序博客网 时间:2024/06/01 09:20
用javascript实现强制网页全屏,最常用的就是使用window.open的方法,直接打开全屏的网页:
<script type="text/javascript">
function fullwin(){
window.open("http://www.phpzixue.cn","bfs","fullscreen,scrollbars")
}
</script>
<center>
<form>
<input type="button" onClick="fullwin()" value="Open Full Screen Window">
</form>
</center>
另外,如果想让已经打开的网页全屏,有以下两种方法:
1.使用ActiveX
<html>
<head>
<title>test</title>
<script language="JavaScript">
function Fkey(){
var WsShell = new ActiveXObject('WScript.Shell')
WsShell.SendKeys('{F11}');
}
</script>
</head>
<body>
<a href="javascript:Fkey()">to full</a>
</body>
</html>
2.使用window.open模拟当前页:
<script type="text/JavaScript">
function toFull(){
if(window.name=="fullscreen")return;
var a =window.open("","fullscreen","fullscreen=yes")
a.location = window.location.href
window.opener=null
window.close()
}
</script>
<html>
<body>
<input type=button value="full" onclick=toFull()>
</body>
</html>
<script type="text/javascript">
function fullwin(){
window.open("http://www.phpzixue.cn","bfs","fullscreen,scrollbars")
}
</script>
<center>
<form>
<input type="button" onClick="fullwin()" value="Open Full Screen Window">
</form>
</center>
另外,如果想让已经打开的网页全屏,有以下两种方法:
1.使用ActiveX
<html>
<head>
<title>test</title>
<script language="JavaScript">
function Fkey(){
var WsShell = new ActiveXObject('WScript.Shell')
WsShell.SendKeys('{F11}');
}
</script>
</head>
<body>
<a href="javascript:Fkey()">to full</a>
</body>
</html>
2.使用window.open模拟当前页:
<script type="text/JavaScript">
function toFull(){
if(window.name=="fullscreen")return;
var a =window.open("","fullscreen","fullscreen=yes")
a.location = window.location.href
window.opener=null
window.close()
}
</script>
<html>
<body>
<input type=button value="full" onclick=toFull()>
</body>
</html>
- 用javascript实现强制网页全屏
- html5实现网页全屏
- JS实现网页全屏与退出全屏
- JS实现网页全屏与退出全屏
- javascript实现页面全屏,
- 强制关闭网页js实现
- 用JS实现网页里的Flash全屏功能
- 用JavaScript实现网页时钟
- IE下使用控件实现网页全屏
- JS实现网页全屏和退出
- laravel使用phantomJS实现网页全屏截图
- JQuery设置网页全屏代码实现
- VideoJS 网页直播实现双击全屏
- 实现强制刷新网页的代码
- 用Javascript实现Agent(网页精灵)(1)
- 用Javascript实现Agent(网页精灵)
- 用Javascript 实现网页的消息循环?
- javascript实现网页后退
- C++中 public,protected, private 访问标号最准确总结
- Flex映射java对象进行互操作
- aiwi国内最大体感游戏平台 领跑体感游戏第一线
- 定时自动操作数据库——Oracle JOB 用法小结
- cannot set autotrace
- 用javascript实现强制网页全屏
- 大学计算机基础论文的具体内容
- java类的内存分配机制
- php讀取excel
- C# 线程 的研究
- oracle用Authid Current_User 定义的建表过程plsql可执行别的用户对象,但是job却不能调用
- Windows Phone 7的本地存储——IsolatedStorageSettings
- 成功移植linux2.6.38内核到TQ2440(转)
- Calendar 使用注意