简体   繁体   English

Internet Explorer 11无法通过Fullscreen API进入全屏模式

[英]Internet Explorer 11 doesn't enter fullscreen via Fullscreen API

I am trying to use fullscreen api. 我正在尝试使用全屏api。 API works correctly all other browsers, but unfortunately ie11 doesn't response. API可以正常运行所有其他浏览器,但不幸的是ie11没有响应。 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 . 确保您没有使用无效的msRequestFullScreen ,您需要使用大小写正确的版本msRequestFullscreen This is Microsoft specific as I think all of the other vendors made the s for the word screen uppercase. 这是微软特有的,因为我认为所有其他供应商都为屏幕大写字体做了s

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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