JQuery wait for page to finish loading before starting the slideshow?

DevDevDev picture DevDevDev · Sep 16, 2009 · Viewed 101.6k times · Source

I have a site with a rotating header image (you've all seen them). I want to do the following:

  1. Load the entire page plus the first header image
  2. Start the header image slideshow transitioning every x seconds or when the next image has finished loading, whichever is later

I haven't really need an example that truly does this.

Answer

Website-Chef picture Website-Chef · Aug 2, 2010

you can try

$(function()
{

$(window).bind('load', function()
{

// INSERT YOUR CODE THAT WILL BE EXECUTED AFTER THE PAGE COMPLETELY LOADED...

});
});

i had the same problem and this code worked for me. how it works for you too!