jQuery/JavaScript: Trigger when preloaded

Posted by user317563 on Stack Overflow See other posts from Stack Overflow or by user317563
Published on 2010-05-10T16:43:40Z Indexed on 2010/05/10 17:04 UTC
Read the original article Hit count: 158

Hello there,

jQuery has the .ready() function, but I am unsure whether this is what I need:

I set a default background image in CSS (imange 1 out of 4), once document is loaded (images and all, not only DOM); I want to start preloading background image 2 out of 4. Once that is loaded, I want to fade image 1 into image 2. Then I want to preload the next image (3 out of 4), once that is loaded, I want to fade from background image 2 into image 3, and finally preload image 4. Once image 4 is loaded, i would like to fade image 3 into image 4. After that, I want to cycle between the images with a set time interval.

What strategy would I use to solve this? .load() function?

Thank you for your time.

Kind regards,
Marius

© Stack Overflow or respective owner

Related posts about trigger

Related posts about preload