js监听全屏下的esc事件 JavaScriptesc
程序员文章站
2022-06-12 10:53:46
...
window.onresize = function() { if (!checkFull()) { //触发esc事件,执行业务逻辑。 } }; function checkFull() { var isFull = document.fullscreenEnabled || window.fullScreen || document.webkitIsFullScreen || document.msFullscreenEnabled; if (isFull === undefined) isFull = false; return isFull; }