Question

Hi I have a web page that I want to open a div element (with an ID) and its contents from the existing page into fullscreen. It works fine in FF and Chrome but does not work in IE10 or IE11. I get no errors in the console log.

I used a similar methodology to this online example I found which also does not work for me in IE: http://davidwalsh.name/demo/fullscreen.php. Is there a setting in IE that needs to be enabled to display fullscreen? F11 works fine for me. I thought there might be a security setting?

I am using the code as defined within MS own documentation: http://msdn.microsoft.com/en-us/library/ie/dn254939(v=vs.85).aspx

function requestFullScreen(element) {
           // Supports most browsers and their versions.
       var requestMethod = element.requestFullScreen || 
                            element.webkitRequestFullScreen || 
                            element.mozRequestFullScreen || 
                            element.msRequestFullScreen;

        console.log("element.msRequestFullScreen" + element.msRequestFullScreen);

        if (requestMethod) { // Native full screen.

            requestMethod.call(element);
        } else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
            var wscript = new ActiveXObject("WScript.Shell");
            if (wscript !== null) {
                wscript.SendKeys("{F11}");
            }
        }
    }

  $(".fullscreen").live('click',function(event) {


     var elem = document.getElementById("fulltextview"); // Make the fulltext    
   view elements contents go full screen.
  requestFullScreen(elem);
});

In this example the variable requestMethod is always undefined.
Is it because IE is not detecting the onclick event and therefore blocking the request due to security concerns? More help needed. (yes, I am forced to use an old version of jQuery 1.4.4)

Was it helpful?

Solution

IE10 does not support full screen

IE11 supports standard version, e.g. msRequestFullscreen(). Note that the s is lowercase.

Lots of good information here: http://generatedcontent.org/post/70347573294/is-your-fullscreen-api-code-up-to-date-find-out-how-to

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top