WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't know if I'm in the right place because is not strictly for Wordpress, I think someone can get some benifit of this question without using Wordpress but in this case I'm using it.

So, I'm using a modified theme with some plugin enabled, carousel, and other fancy things. There is a problem with some graphics, when I call the site from a remote host, and it's not cached, it's not quick as it's in localhost so all the images are preload in the same place one above the other and when the JS is ready all go in place, but you see a mess while the site is reading...

This is not very nice as you thinking...

My intention is to achive a "site is loading" pulsating or a progress bar while the site is ready in background.

How to do this?

share|improve this question
jQuery plugin – Milo Aug 2 '11 at 14:48
up vote 0 down vote accepted

This is NOT a good idea. If you get that kind of behavior, then you didn't properly code your carousel thing / CSS. You should hide the element that contains it, and reveal it in the js hook.

But if you really want to go your way, here's how:


<body <?php body_class('site-loading no-js'); ?>>
     document.body.className = document.body.className.replace('no-js','has-js');


  background: #fff url('the/loading.gif') no-repeat center center;

body.site-loading.has-js *{

javascript, assuming jQuery:

   // do your carousel thing

   // should be last line

Needless to tell you that any javascript error after the header code I gave you, will keep your site in "loading" mode forever :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.