Put screen to fullscreen and keep it even if you click on another site on the page

0

Good morning.

I have a button that when pressed, the browser is put in full screen, and another button that when you press it, the whole screen is removed.

Up to here everything works for me ok. The problem I have is that when I put on full screen, if I click on another site on the same website (another menu option, etc) the full screen is automatically removed.

The code is as follows:

function pasarPantallaCompleta(element){
    // Encuentra el método correcto, llama al elemento correcto
    if(element.requestFullScreen) {
        element.requestFullScreen();
    } else if(element.mozRequestFullScreen) {
        element.mozRequestFullScreen();
           } else if(element.webkitRequestFullScreen) {
                    element.webkitRequestFullScreen();
                }
                // Lanza en pantalla completa en navegadores que lo soporten
                launchFullScreen(document.documentElement); // la página entera
            }

This is the function responsible for putting it in full screen. What I want is to keep it in full screen until the other function of removing full screen is called.

I tried calling the show all the time but it does not work.

Any ideas?

Thank you very much.

This is the code that removes the entire screen:

function quitarPantallaCompleta() {
    if(document.cancelFullScreen) {
        document.cancelFullScreen();
    } else if(document.mozCancelFullScreen) {
            document.mozCancelFullScreen();
        } else if(document.webkitCancelFullScreen) {
                    document.webkitCancelFullScreen();
                }
            }

I have done it with two links to be able to put a drawing. Therefore I put it like that. Complete example:

<a href="javascript: pasarPantallaCompleta(document.documentElement)"></a>
<a href="javascript: quitarPantallaCompleta()"></a>
    
asked by M. Giner 24.11.2017 в 08:51
source

0 answers