Search code examples
javascriptjqueryhtmlresponsive-designfullscreen

Fullscreen not working in IE


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.


Solution

  • 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.