Full screen when loading page

0

How to give a Full Screen on a page as soon as the browser finishes loading it, but also works in Android OS browsers? I've already used the famous load to trigger the event after loading the window.

 $(window).load("on", function (){
     //...code...
 });

But I did not succeed even in Chrome on my PC. Part of Full Screen was able to resolve using the fullscreen.js plugin. However, I can not make it work as soon as the page loads. Follow the Fiddle as I have implemented so far by firing the full screen by clicking on the text that is in a H1 tag. I also use jQuery in the project, but what's in Fiddle is just a test. The project I'm going to use is much larger.

    
asked by anonymous 20.11.2014 / 00:58

1 answer

1

You can try to start using the syntax below:

$(window).on('load', function () { ... });

I would also try to put a setTimeout as security. After the page loads, it performs something after 1 second. Example:

$(window).load(function () {

   setTimeout(function () {
      telaCheia();
   }, 1000);

});

function telaCheia() {
  if (screenfull.enabled) {
    screenfull.request();
  }
  ...
}
    
20.11.2014 / 02:59