当前位置:首页 » JavaScript技术

js监听全屏下的esc事件

2018-05-04 16:03 本站整理 浏览(22)
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;
		}