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

227
Visualizações
Why scrolling of page is not working when the cursor is over an iframe?

So I made an overlay div over the iframe. I want to show the overlay div when someone is scrolling over the iframe. And I want to remove the overlay when someone is hovering over the iframe to interact with the iframe. There is something wrong with my code. Can anyone show the right way to do it? This is my code:

<div onwheel="f2()" style="display: flex; justify-content: center; height: 90vh; margin-top: 10vh">
     <iframe src="gooey.html" id="gooey" style="position: absolute; z-index: 2; border: 0; width:80vw; height: 100vh;"></iframe>
</div>

<div onmouseover="f1()" style="position: absolute; top:0; left:10vw; right:10vw; bottom:0; z-index: 3;" id="overlay">
</div>

<div class="image-container">
    .............
</div>

Javascript:

function f1() {
   document.getElementById("overlay").style.display = "none";
}

function f2() {
   document.getElementById("overlay").style.display = "block";
}
about 4 years ago · Juan Pablo Isaza
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