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

139
Visualizações
triggering event on reaching bottom of iframe by scrolling

I'm trying to insert an onscroll event to an IFRAME in HTML code, in order to trigger an event when the user has scrolled the site/document all the way to the bottom.

I found several suggestions on "stackoverflow", and tried to use them but for some reason The code I inserted doesn't work.

this is one example to my code:

<!DOCTYPE html>
<html>
<body>
<p>Click the button to change the value of the src attribute in the iframe.</p>
<input type= "url" id="hi" value = "hello" onchange="myFunction2()">

<button onclick="document.getElementById('myFrame').src = document.getElementById('hi').value;" id=getFile >Upload File</button></br></br>

<iframe id="myFrame" src="https://agilepoint.com/"></iframe>

<p id="demo"></p>

<script>


window.onscroll = function(ev) {
    var Frame = document.getElementById("myFrame");
    if ((Frame.innerHeight + Frame.scrollY) >= document.body.offsetHeight) {
        alert("you're at the bottom of the page");
    }
};


</script>
</body>
</html>

Also tried this:

<!DOCTYPE html>
<html>
<body>
<p>Click the button to change the value of the src attribute in the iframe.</p>
<input type= "url" id="hi" value = "hello" onchange="myFunction2()">

<button onclick="document.getElementById('myFrame').src = document.getElementById('hi').value;" id=getFile >Upload File</button></br></br>

<iframe id="myFrame" src="https://agilepoint.com/"></iframe>

<p id="demo"></p>

<script>


document.getElementById("myFrame").onscroll = function(ev) {
    var Frame = document.getElementById("myFrame");
    if ((Frame.innerHeight + Frame.scrollY) >= document.body.offsetHeight) {
        alert("you're at the bottom of the page");
    }
};


</script>
</body>
</html>

Didn't work. I'd appreciate the help. thanks!

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