0

I have a page with a div #container which I would like to have go into full screen mode (or at least request to go into full screen mode) on supported browsers.

I downloaded this plugin and although the example all show using a button to enter fullscreen, I'd like to do it on load.

I tried:

$(window).load(function() { if($.support.fullscreen){ $('#container').fullScreen(); } });

  • 1
    As the documentation more than clearly states this is not possible due to good reasons. What you can do is offer a button "fullscreen". And you can make your stuff fullscreen when the user clicks that button. This is all documented. But you need that interaction, no way without. – arkascha Oct 11 '14 at 19:02
  • Possible duplicate of http://stackoverflow.com/questions/1125084/how-to-make-in-javascript-full-screen-windows-stretching-all-over-the-screen – Marcus Rommel Oct 11 '14 at 20:40

1 Answers1

0

You can do this sort of using a popup and window.open, or center it then make it H/W proportionate to the screen size. But it is a very bad idea (of course subject to popup blocking), and could be considered malicious behavior by some users. Full screen should be a choice, not a default option as there is little legitimate reason to go that route unless you offer the user at least the chance to save a setting to accept this behavior on subsequent visits. Otherwise there are tricks to get it from the main page, google can lead you that route should you decide to do it, I however still suggest highly against it.

Sabre
  • 2,350
  • 2
  • 18
  • 25