小程序流程洞见_js模仿F11页面全屏显示

2021-01-07 11:12| 发布者: | 查看: |

js模拟F11页面全屏显示       这篇文章主要为大家详细介绍了js模拟实现F11使页面全屏显示,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
var btn = document.getElementById('btn'); var content = document.getElementById('content'); btn.onclick = function(){ console.log(content); fullScreen(content); var quite = document.getElementById('quite'); quite.onclick = function(){ exitFullScreen(); function fullScreen(el) { var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen, wscript; if(typeof rfs != "undefined" rfs) { rfs.call(el); return; if(typeof window.ActiveXObject != "undefined") { wscript = new ActiveXObject("WScript.Shell"); if(wscript) { wscript.SendKeys("{F11}"); function exitFullScreen(el) { var el= document, cfs = el.cancelFullScreen || el.webkitCancelFullScreen || el.mozCancelFullScreen || el.exitFullScreen, wscript; if (typeof cfs != "undefined" cfs) { cfs.call(el); return; if (typeof window.ActiveXObject != "undefined") { wscript = new ActiveXObject("WScript.Shell"); if (wscript != null) { wscript.SendKeys("{F11}"); /script /body /html

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持凡科。


<
>

 
QQ在线咨询
售前咨询热线
18720358503
售后服务热线
18720358503
返回顶部