I have in a page an animation and as the animation keeps playing I want to preload images.
The animation is like an the intro. At the point the animation plays I want to load several images and background images for some elements and the images are loaded then continue make a callback.
For example I want to load the images of an img elements:
<img src="image1.png">
<img src="image2.png">
<img src="image3.png">
and then a few images which are set within the css file:
.figure1{background-image:url('fig1.png')}
.figure2{background-image:url('fig2.png')}
.figure3{background-image:url('fig3.png')}
When all the images are loaded, then continue to the other function.
An example of my animation:
$('#coolanimation').delay(1000).fadeIn("slow", function() {
// Load images here and when loaded do this:
$('#intro').fadeOut("slow", function() { $(this).remove();
});
});