JS控制页面全屏

</span></p><p><span style="white-space: nowrap;"><meta http-equiv="refresh" content="20"></span></p><p><span style="white-space: nowrap;"></head></span></p><p><span style="white-space: nowrap;"><script type="text/javascript"></span></p><p><span style="white-space: nowrap;">var WshShell=new ActiveXObject("WScript.Shell");</span></p><p><span style="white-space: nowrap;">//禁用xinxp弹出窗口阻止程序</span></p><p><span style="white-space: nowrap;">WshShell.RegWrite("HKCU\\Software\\Microsoft</span></p><p><span style="white-space: nowrap;">\\Internet Explorer</span></p><p><span style="white-space: nowrap;">\\New Windows</span></p><p><span style="white-space: nowrap;">\\PopupMgr","no");</span></p><p><span style="white-space: nowrap;">function full() {</span></p><p><span style="white-space: nowrap;">var el = document.documentElement;</span></p><p><span style="white-space: nowrap;">var rfs = el.requestFullScreen </span></p><p><span style="white-space: nowrap;">|| el.webkitRequestFullScreen </span></p><p><span style="white-space: nowrap;">|| </span><span style="white-space: nowrap; line-height: 1.42857;">el.mozRequestFullScreen </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">|| el.msRequestFullScreen;</span></p><p><span style="white-space: nowrap;">if(typeof rfs!="undefined"&&rfs){</span></p><p><span style="white-space: nowrap;">    rfs.call(el);</span></p><p><span style="white-space: nowrap;">  } </span></p><p><span style="white-space: nowrap;">else if(typeof window.ActiveXObject!="undefined") </span></p><p><span style="white-space: nowrap;">{</span></p><p><span style="white-space: nowrap;">//for IE,模拟键盘的F11,使浏览器全屏</span></p><p><span style="white-space: nowrap;">var wscript = new ActiveXObject("WScript.Shell");</span></p><p><span style="white-space: nowrap;">if(wscript != null) {</span></p><p><span style="white-space: nowrap;">        wscript.SendKeys("{F11}");</span></p><p><span style="white-space: nowrap;">    }</span></p><p><span style="white-space: nowrap;">  }</span></p><p><span style="white-space: nowrap;">}</span></p><p><span style="white-space: nowrap;">function exit() {</span></p><p><span style="white-space: nowrap;">var el = document;</span></p><p><span style="white-space: nowrap;">var cfs = el.cancelFullScreen </span></p><p><span style="white-space: nowrap;">|| el.webkitCancelFullScreen </span></p><p><span style="white-space: nowrap;">|| </span><span style="white-space: nowrap; line-height: 1.42857;">el.mozCancelFullScreen </span></p><p><span style="white-space: nowrap; line-height: 1.42857;">|| el.exitFullScreen;</span></p><p><span style="white-space: nowrap;">if(typeof cfs != "undefined" && cfs) {</span></p><p><span style="white-space: nowrap;">    cfs.call(el);</span></p><p><span style="white-space: nowrap;">  } </span></p><p><span style="white-space: nowrap;">else if(typeof window.ActiveXObject != "undefined") </span></p><p><span style="white-space: nowrap;">{</span></p><p><span style="white-space: nowrap;">//for IE,和fullScreen相同,模拟F11键退出全屏</span></p><p><span style="white-space: nowrap;">var wscript = new ActiveXObject("WScript.Shell");</span></p><p><span style="white-space: nowrap;">if(wscript != null) {</span></p><p><span style="white-space: nowrap;"> wscript.SendKeys("{F11}");</span></p><p><span style="white-space: nowrap;">    }</span></p><p><span style="white-space: nowrap;">  }</span></p><p><span style="white-space: nowrap;">}</span></p><p><span style="white-space: nowrap;">setTimeout("full()",1000);</span></p><p><span style="white-space: nowrap;">window.onload=full();//不要括号</span></p><p><span style="white-space: nowrap;">

 

本文地址:http://www.vnote.net/index.php?m=Home&c=Article&a=index&id=35


回复列表



回复操作

正在加载验证码......

请先拖动验证码到相应位置

发布时间:2015-11-15 14:24:33

修改时间:2015-11-15 14:24:33

查看次数:979

评论次数:0