Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

124
Visualizações
is there any way to enter into fullscreen mode onload of page?

I am working on quiz and want to convert the screen into fullscreen mode on load of page for specific time, is there any way to achieve this or any alternative?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

User interaction is required to enter full-screen mode. This is a security feature.

Imagine being able to force a popup window of some kind to go full screen, lock the mouse pointer, and play an ad without permission. Having an "Enable Full Screen" link or button whose visibility is toggled in the "Change Full Screen" event handler in the the documentation seems like a pragmatic/better approach.

Even if you'll try, you will get the following error message

Failed to execute 'requestFullScreen' on 'Element': API can only be initiated by a user gesture.

So, It's not possible to load a page on fullscreen mode but you can use the following code to trigger it on some action:

<script>
/* Get the documentElement (<html>) to display the page in fullscreen */
var elem = document.documentElement;

/* View in fullscreen */
function openFullscreen() {
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.webkitRequestFullscreen) { /* Safari */
    elem.webkitRequestFullscreen();
  } else if (elem.msRequestFullscreen) { /* IE11 */
    elem.msRequestFullscreen();
  }
}

/* Close fullscreen */
function closeFullscreen() {
  if (document.exitFullscreen) {
    document.exitFullscreen();
  } else if (document.webkitExitFullscreen) { /* Safari */
    document.webkitExitFullscreen();
  } else if (document.msExitFullscreen) { /* IE11 */
    document.msExitFullscreen();
  }
}
</script>

Reference: w3Schools - Full Screen

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda