JS full screen and exit full screen
JS browser window to achieve full screen and exit Full-screen function, the market mainstream browser such as: Google, Firefox, 360 are compatible, but the IE low version of a bit of a flaw (full screen state still has the bottom of the status bar).
This demo is basically enough, directly copy the following source code saved as an HTML file to see the effect of it.
Exit full screen to determine browser type
function Exitfull () {
//judge various browsers, find the correct method
var exitmethod = Document.exitfullscreen | |//w3c
Document.mozcancelfullscreen | | Chrome etc
Document.webkitexitfullscreen | |//firefox
document.webkitexitfullscreen//IE11
if ( Exitmethod) {
exitmethod.call (document);
}
else if (typeof window. ActiveXObject!== "undefined") {//for Internet Explorer
var wscript = new ActiveXObject ("Wscript.Shell");
if (wscript!== null) {
WScript. SendKeys (' {F11} ');
}} </script>
Thank you for reading, hope Tender help to everyone, thank you for your support of this site!