1 //设置浏览器全屏 2 function f_SetFullScreen() { 3 //如果浏览器不是全屏则将其设置为全屏模式 4 if (!f_IsFullScreen()) { 5 var wsShell = new ActiveXObject('WScript.Shell'); 6 wsShell.SendKeys('{F11}'); 7 return false; 8 } 9 } 10 11 //判断浏览器是否全屏 12 function f_IsFullScreen() { 13 return (document.body.scrollHeight == window.screen.height && document.body.scrollWidth == window.screen.width); 14 }