浏览器模拟F11_李孟_新浪博客

【浏览器模拟F11_李孟_新浪博客】关山初度尘未洗,策马扬鞭再奋蹄!这篇文章主要讲述浏览器模拟F11_李孟_新浪博客相关的知识,希望能为你提供帮助。
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();

    推荐阅读