The function is very simple, the code is also very concise, here is not much nonsense
function fullscreen () {
var el = document.documentelement,
RFS = El.requestfullscreen | | El.webkitrequestfullscreen | | El.mozrequestfullscreen | | El.msrequestfullscreen,
WScript;
if (typeof RFS!= "undefined" && RFS) {
rfs.call (EL);
return;
}
if (typeof window. ActiveXObject!= "undefined") {
wscript = new ActiveXObject ("Wscript.Shell");
if (wscript) {
WScript. SendKeys (' {F11} ');
}} function Exitfullscreen () {
var el = document,
CFS = El.cancelfullscreen | | el.webkitcancelfullscreen | | el.moz Cancelfullscreen | | El.exitfullscreen,
WScript;
if (typeof cfs!= "undefined" && cfs) {
cfs.call (EL);
return;
}
if (typeof window. ActiveXObject!= "undefined") {
wscript = new ActiveXObject ("Wscript.Shell");
if (wscript!= null) {
WScript. SendKeys (' {F11} ');}}
The above mentioned is the entire content of this article, I hope you can enjoy.