Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!