Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

143
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda