Getting fullscreen

Okay, so what about a link that sends you to a section and resolves fullscreen. Ya know, like:

Would ya like some o' that good ol' fullscreen, broski?
[[yes]]
[[no]]

[[yes]]:
*This is where you get some o' that good ol' fullscreen, ya know?*
good good

Is this achievable?


Don't know Squiffy that well, but the javascript probably works.

The javascript to open fullscreen will be:

    document.documentElement.requestFullscreen();

Or so that it works on older browsers:

    var doc = document.documentElement;
    if (doc.requestFullscreen) {
      doc.requestFullscreen();
    } else if (doc.mozRequestFullScreen) {
      doc.mozRequestFullScreen();
    } else if (doc.msRequestFullscreen) {
      doc.msRequestFullscreen();
    } else if (doc.webkitRequestFullscreen) {
      doc.webkitRequestFullscreen();
    }

And to exit fullscreen mode, it would be:

    if (document.exitFullscreen) {
      document.exitFullscreen();
    } else if (document.mozCancelFullScreen) {
      document.mozCancelFullScreen();
    } else if (document.msExitFullscreen) {
      document.msExitFullscreen();
    } else if (document.webkitExitFullscreen) {
      document.webkitExitFullscreen();
    }

Works like a charm. Thank you!


Log in to post a reply.

Support

Forums