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

95
Views
Page loading div loads endless sometimes

My pre page load script sometimes bugs out and is “loading” endless.

No console logs. Page is loaded correctly under the cover div.

It’s hard to explain any logic to moment it happens, looks like random thing.

custom.js:

$(function() {
    $(window).on("load", function(){
        $('#loader').css("display", "none", function() {
          $(this).remove();
        });
        $('html, body').css({
            'overflow': 'auto',
        })
    })
});

header.php:

<body <?php body_class('d-flex flex-column h-100 no-scroll');?>>

<div id="loader"><p>Loading</p></div>
    <?php wp_body_open(); ?>

    <header class="site-header”>

[...]

I’m using Wordpress.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You can remove the onLoad listener from your function. That might be a problem due to variaous reasons. Can you try:

$(window).on("load", function(){
    $('#loader').css("display", "none", function() {
      $(this).remove();
    });
    $('html, body').css({
        'overflow': 'auto',
    })
})
about 4 years ago · Santiago Trujillo Report

0

On load

$( window ).on("load", function() {
    ...trigger load
});

When document loaded

$( document ).ready(function() {
   ...remove loading
});
about 4 years ago · Santiago Trujillo 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!