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

362
Views
HTML preloader delay (Elementor)

I need some help. So there is this page that is using an iframe, for that reason the Cumulative Layout shift is pretty noticeable. So we wanted to use a preloader so that you cant see that. But the preloader code only shows the preloader for like 100ms. I wanted to change this is so I added this code in between the script tag. But now the preloader isn't going away at all. Just spinning on forever

This is the code:

jQuery(document).ready(function($) {
  $(window).load(function() {
    setTimeout(function() {
      $('#preloader').fadeOut('slow', function() {});
    }, 200); // set the time here
  });
});
.loader {
  position: fixed;
  left: 0px;
  top: 0px;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: url('https://example.com/example.svg') 50% 50% no-repeat #aa9767;
  /* Change the #fff here to your background color of choice for the preloader fullscreen section */
}

.elementor-editor-active .loader {
  display: none;
}
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<div class="loader"></div>

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

0

Two things seems wrong:

  1. Your selector seems wrong, I am assuming its meant to be .loader

  2. The function parameter in document.ready doesn't take parameters

    jQuery(document).ready(function() {
      $(window).load(function() {
       setTimeout(function() {
        $('.loader').fadeOut('slow');
       }, 200); // set the time here
     });
    });
    
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!