js监听全屏下的esc事件

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;
		}

转载于:https://www.cnblogs.com/baryon/p/9611374.html

你可能感兴趣的:(javascript)