萬盛學電腦網

 萬盛學電腦網 >> 腳本專題 >> javascript >> js控制浏覽器全屏示例代碼

js控制浏覽器全屏示例代碼

 控制浏覽器全屏的方法有很多,下面為大家介紹下js是如何做到的

 代碼如下: function fullScreen() {  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") {  // for Internet Explorer  var wscript = new ActiveXObject("WScript.Shell");  if (wscript != null) {  wscript.SendKeys("{F11}");  }  }    }     
copyright © 萬盛學電腦網 all rights reserved