var fullindex=1; function fullscreen(){ if ($.browser.msie && $.browser.version.indexOf("8") == 0) { if(typeof window.ActiveXObject != "undefined") { //for IE8,这里和fullScreen相同,模拟按下F11键退出全屏 var wscript = new ActiveXObject("WScript.Shell"); if(wscript != null) { wscript.SendKeys("{F11}"); } } }else if(parseInt(fullindex)==1){ var docElm = document.documentElement; //W3C if (docElm.requestFullscreen) { docElm.requestFullscreen(); } //FireFox else if (docElm.mozRequestFullScreen) { docElm.mozRequestFullScreen(); } //Chrome等 else if (docElm.webkitRequestFullScreen) { docElm.webkitRequestFullScreen(); } //IE11 else if (docElm.msRequestFullscreen) { docElm.msRequestFullscreen(); } fullindex=0; }else if(parseInt(fullindex)==0){ if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen();
浏览器模拟F11
2023-06-28 15:26:25
浏览数 (1)