Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep fullscreen api in fullscreen after clicking on a link

I am using the HTML5 fullscreen API so users can view my website in fullscreen, however when a user clicks a link (such as a menu item) the user switches back to the normal browser mode. How can I keep the browser in fullscreen when the user clicks certain links? Preferably without having to convert the whole website to an AJAX page load system.

like image 583
Hidde Stokvis Avatar asked May 23 '12 12:05

Hidde Stokvis


People also ask

What is Full screen API?

The Fullscreen API adds methods to present a specific Element (and its descendants) in fullscreen mode, and to exit fullscreen mode once it is no longer needed.

How do I force HTML full screen?

Full-screen can be activated for the whole browser window by pressing the F11 key. It can be exited by pressing the Esc button.

How do I make Div full screen on button click?

You'll want a fixed position element at 100% width and height , if you don't have a background color or image you'll be able to click through it. Set z-index higher then all other elements to ensure it is at the front if you need that.


1 Answers

It will not be possible to do this without converting to an AJAX loading system. When you navigate to a different page, the DOM tree is destroyed, but the element you are putting into fullscreen mode is part of said DOM tree.

like image 152
chucktator Avatar answered Sep 27 '22 17:09

chucktator