欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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;
		}
相关标签: JavaScript esc