/* 全屏 */ function requestFullScreen() { var element = document.getElementById('topo'); // topo为你要全屏的对象 element.style.width = '100%'; var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen; if (requestMethod) { requestMethod.call(element); } else if (typeof window.ActiveXObject !== "undefined") { var wscript = new ActiveXObject("WScript.Shell"); if (wscript !== null) { wscript.SendKeys("{F11}"); } } } /* 全屏 结束 */
JS实现全屏
最新推荐文章于 2024-03-13 20:41:30 发布