简体   繁体   中英

Exit full screen mode of IE 10 or less using javascript

I am unable to exit the full screen mode of IE using javascript.

Code for exiting full screen which i ma using is:

 docElement.msCancelFullScreen();

I also tried

 docElement.exitFullscreen();

I searches alot on web but nothing works for me.. Please help me..

You can't, IE10 and below don't support the FullScreen API . The user can easily exit it, but there's no IE API to do so. If there were an older, IE-specific API, they'd probably mention it here .


I will just note, though, that the ms-prefixed function for exiting full screen mode is msExitFullscreen , not msCancelFullScreen .

You can try this:

<script type="text/javascript">
    function max() {
        var wscript = new ActiveXObject("Wscript.shell");
        wscript.SendKeys("{F11}");
    }
</script>

THe fullscreen API you are using is IE11 specific. It will not work in IE10 or less. http://msdn.microsoft.com/en-us/library/ie/dn265028(v=vs.85).aspx

See Internet Explorer full screen mode? For a workaround.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM