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

134
Visualizações
Make div go fullscreen inside iframe

I have the html like below:

<html>
   <body>
      <div>Welcome.</div>
      <iframe src='otherpagecontent' width='594' height='334'>
        #docuemnt
        <html>
            <body>
              <div style='color:yellow'>
              This should not show in fullscreen.
              </div>
              <div style='color:yellow'>
              This should not show in fullscreen.
              </div>
              <div id='fullscreen' style='color:blue;'>
              This should go fullscreen only.
              </div>
              <div style='color:red'>
              This should not show in fullscreen.
              </div>
              <div style='color:red'>
              This should not show in fullscreen.
              </div>
            </body>
        </html>
      </iframe>
      <iframe src='diffirentpage'>
        #docuemnt
        <button onclick="launchFullscreen(document.getelementByID('fullscreen'));">Launch Fullscreen</button>
      </iframe>
   </body>
</html>

In JS:

this.launchFullscreen= function (element) {
    var requestFullScreen = (element.requestFullScreen || element.mozRequestFullScreen || element.webkitRequestFullScreen || element.msRequestFullscreen);
    requestFullScreen.apply(element);
}

Result in Request for fullscreen was denied because of FeaturePolicy directives.

How can I get this <div id='fullscreen'> to go fullscreen? Should I change the CSS for this <div>, or bind the request from somewhere else?

PS: This work fine on Chrome, but issue occur on Firefox.

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

0

Yes, you should use CSS for this. You can't force the user into full-screen by F11; however, you can make your div full screen by using the following CSS

div {width: 100%; height: 100%;}

This will of course assume your div is child of the tag. Otherwise, you'd need to add the following in addition to the above code.

div {position: absolute; top: 0; left: 0;}

from:How do I make a div full screen?

about 4 years ago · Juan Pablo Isaza Relatório

0

You might try this

<iframe src="myurl.in"
frameborder="0" 
marginheight="0" 
marginwidth="0" 
width="100%" 
height="100%" 
scrolling="auto"></iframe >

from: https://www.geeksforgeeks.org/how-to-set-fullscreen-iframe/

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