浏览器宽屏的js

发表于 JS 分类,标签:

$(function(){

// 满屏幕方法

$("#fullScreen").click(function(){

fullScreen()

  }).trigger("click")

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"){

//   ie支持

 var wscript = new ActiveXObject("WScript.Shell");

 if (wscript!=null) { 

wscript.SendKeys("{F11}"); 

}

}

};

fullScreen();

});


0 篇评论

发表我的评论