简体   繁体   中英

Internet Explorer 11 doesn't enter fullscreen via Fullscreen API

I am trying to use fullscreen api. API works correctly all other browsers, but unfortunately ie11 doesn't response. I am using this code which has copied from here:

var element = $doc.documentElement;
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;

    if (requestMethod) 
    { // Native full screen.
        console.log(requestMethod);
        requestMethod.call(element);
    } 
    else if (requestMethod !== "undefined") 
    { // Older IE.
        console.log("window.ActiveXObject !== undefined");
        var wscript = new ActiveXObject("Wscript.shell");
        wscript.SendKeys("{F11}"); 
    }

Any suggestions?

Ensure you're not using the invalid msRequestFullScreen , you need to be using the case-correct version, msRequestFullscreen . This is Microsoft specific as I think all of the other vendors made the s for the word screen uppercase.

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