Fullscreen not working in IE

对着背影说爱祢 提交于 2019-12-20 03:35:08

问题


So I have my slider module up and running but Internet Explorer 11 is not responding to the fullscreen button. Firefox and Chrome are working just fine. I found this code on Stack but still no difference. Any thoughts?

function toggleFullScreen() {
  if (!document.fullscreenElement &&    // alternative standard method
      !document.mozFullScreenElement && !document.webkitFullscreenElement) {  // current working methods
    if (document.documentElement.requestFullscreen) {
      document.documentElement.requestFullscreen();
    } else if (document.documentElement.mozRequestFullScreen) {
      document.documentElement.mozRequestFullScreen();
    } else if (document.documentElement.webkitRequestFullscreen) {
      document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
    } else if (elem.msRequestFullscreen) {
            elem.msRequestFullscreen();
    }


  } else {
    if (document.cancelFullScreen) {
      document.cancelFullScreen();
    } else if (document.mozCancelFullScreen) {
      document.mozCancelFullScreen();
    } else if (document.webkitCancelFullScreen) {
      document.webkitCancelFullScreen();
    } else if (document.msExitFullscreen) {
            document.msExitFullscreen();
        }
  }
}

 </script>

Sorry if this question has been answered. I haven't found the solution.


回答1:


According to this site the fullscreen API is not supported in IE. There seem to be no information on whether this is something that will be supported by IE11 either.

According to MDN's article on fullscreen it seems that this technique is still be very much experimental for most browsers.

You could also try this

Internet Explorer full screen mode?

Set window to fullscreen (REAL fullscreen; F11 functionality) by javascript

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

if you really want to have the full screen in internet explorer.... Try giving the slider wiidth and height 100% in jquery.



来源:https://stackoverflow.com/questions/33732805/fullscreen-not-working-in-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!