Make Fullscreen

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function requestFullScreen(e) {
    // Supports most browsers and their versions.
    var requestMethod = e.requestFullScreen || e.webkitRequestFullScreen || e.mozRequestFullScreen || e.msRequestFullScreen;
 
    if (requestMethod) { // Native full screen.
        requestMethod.call(e);
    } else if (typeof window.ActiveXObject !== "undefined") { // Older IE.
        var wscript = new ActiveXObject("WScript.Shell");
        if (wscript !== null) {
            wscript.SendKeys("{F11}");
        }
    }
}
 
var elem = document.body; // Make the body go full screen.
requestFullScreen(elem);



References