As we all know, ie is a wonderful browser, but due to the large number of users, developers still have to consider for IE, so, a variety of browser-related operations, there is a special judgment-specifically for IE browser judgment, the full screen here is no exception. Look at the code:
functionfullscreen () {varEl =document.documentelement; varRFS = El.requestfullscreen | | El.webkitrequestfullscreen | |El.mozrequestfullscreen||El.msrequestfullscreen; if(typeofRFS! = "undefined" &&RFS) {Rfs.call (EL); } Else if(typeofWindow. ActiveXObject! = "undefined") { //For IE, this is actually simulating the F11 of pressing the keyboard, making the browser full screen varwscript =NewActiveXObject ("Wscript.Shell"); if(WScript! =NULL) {WScript. SendKeys ("{F11}"); } }}
Here is a simple example (assuming the above code is saved in the Script.js file): This function is called in the button:
IE browser-compatible JS browser full-screen code