首页 > js写的f11全屏功能firefox\google下有效但在ie下无效是怎么回事??

js写的f11全屏功能firefox\google下有效但在ie下无效是怎么回事??

window.onload=function(){
document.getElementById("fullvoide").onclick=function(){
     var el = document.documentElement; 
     var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen; 
     if (typeof rfs != "undefined" && rfs) { 
              rfs.call(el); 
         } else if(typeof window.ActiveXObject != "undefined"){
              var wscript = new ActiveXObject("WScript.Shell");
              if (wscript!=null) { 
                wscript.SendKeys("{F11}"); 
         }
     }  
  }
}

貌似IE6以下的都不支持


不知道你用的IE是什么版本,但根据兼容性和IE的API来看,至少得是IE9才可以用。
你可以看看国外的讨论

【热门文章】
【热门文章】