实际建议通过 高度 在resize 是判读 是否全屏 应该 f11 执行的全屏js 无法判断
// 全屏
var isFullScreen=false
function fullScreen(id) { // el 是要放大的div的id
let el = document.getElementById(id)||document.documentElement;
let screen = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen
let wscript = null
if (typeof screen != "undefined" && screen) {
screen.call(el);
return;
}
if (typeof window.ActiveXObject != "undefined") {
wscript = new ActiveXObject("WScript.Shell");
if (wscript) {
wscript.SendKeys("{F11}");
}
}
isFullScreen=true
}
// 退出全屏
function exitFullScreen() {
let screen = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.exitFullScreen
let wscript = null
if (typeof screen != "undefined" && screen) {
screen.call(document);
return;
}
if (typeof window.ActiveXObject != "undefined") {
wscript = new ActiveXObject("WScript.Shell");
if (wscript != null) {
wscript.SendKeys("{F11}");
}
}
isFullScreen=false
}
标签:el,wscript,screen,js,let,全屏,document,方法
From: https://www.cnblogs.com/7c89/p/17584718.html