Skip to content Skip to sidebar Skip to footer

Trigger Browser Full Screen Mode Via Javascript

When a YouTube video goes full screen, it is relative to the monitor rather than the browser. How can I trigger a browsers full screen mode to display a webpage relative to the mon

Solution 1:

There's a fullscreen browser API in most modern browsers. You can invoke them in Javascript with commands like

if(document.fullscreenEnabled){
    document.getElementById("myimage").requestFullscreen();
}

More info at https://www.sitepoint.com/use-html5-full-screen-api/

Keep in mind you'll have to add much more fullscreen handling code in addition to this.


Post a Comment for "Trigger Browser Full Screen Mode Via Javascript"