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

134
Views
Is it possible to check scrolls down reach the end if iframe src is online url pdf?

Try to add iframe src for an iframe using online pdf url.

But is it possible to check if online pdf is scrolls down and reach the end (not HTML) ? Because if i try to print contentDocument, it's return null

HTML

 <iframe id="myFrame" name="myFrame" class="scroll-y overlay" style="height:300px;"></iframe> 
    
   <label style="cursor:pointer;">
       <input type="checkbox" id="chkTermAndCondition" disabled 
        onchange="handleChange(this);" />
        Approve S and K.
    </label>

JS

$("#myFrame").attr("src","https://upload.wikimedia.org/wikipedia/commons/4/40/GeneralBiology.pdf");
        $("#myFrame").load(function () {
            //console.log("myFrame load function");
            var win_iframe = document.getElementById('myFrame').contentWindow;
            var doc_iframe = document.getElementById('myFrame').contentDocument;


            $(win_iframe).on("scroll", function() {
                if ((win_iframe.innerHeight + win_iframe.scrollY) >= doc_iframe.body.offsetHeight) {
                //console.log("aaa..! works perfectly!");
                $("#chkTermAndCondition").removeAttr("disabled");
                }
            });
        });
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!