var el = document.documentElement
, rfs = // for newer Webkit and Firefox
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}");
}
}
旧版本IE就不要多想了 老老实实用
location.hash
简单模拟吧至于全屏 百度一下 IE下全屏 F11 能找到相关代码
new ActiveXObject('WScript.Shell').SendKeys('{F11}')
非IE的百度一大把 全面一点上MDN