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

332
Views
Iframe loading spinner/progress bar using javascript

I have an iframe which is referencing a Google Sheets tab, and its quite slow loading. I'm looking to have a spinner graphic or loader % progress bar (even more ideal) whilst the iframe is loading. Would you know an approach for this using Javascript and/or CSS please?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

If jQuery is an option. -> Not perfectly styled but I hope you get the idea.

$('#myIframe').on('load', function(){
    $('#loader').fadeOut();
});
iframe {
  height:500px;
  width:500px;
}
#loader {
  position:absolute;
  height:500px;
  width:500px;
  background:#000;
  margin-top:-500px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<iframe src="https://www.brotherops.com" id="myIframe"></iframe>
<div id="loader"><img src="https://i.giphy.com/media/FaAxdPWZ7HKGmlnku7/giphy.webp" alt="Loading" /></div>

about 4 years ago · Juan Pablo Isaza Report

0

No need to use jquery for this. If you would like to use an actual progress bar, you'd have to use ajax to load the content.

function closeIndicator(){
  var s = document.getElementById('spinner');
  console.log(s);
  s.style.display = "none";
}
#spinner{
  z-index:99999;
  position:absolute;
  top: 0;
  left: 0;
 }
 
<iframe id="documentIFrame" onload="closeIndicator()" src="https://stackoverflow.com/" >
</iframe>
<img id="spinner" src="spinnder.gif" />

about 4 years ago · Juan Pablo Isaza Report
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!