I want to create a slideshow which contains some 30-40 images. I want to load all these images before showing the slide show, how it can be done? I will play my slideshow only after all images are loaded.
Asked
Active
Viewed 1,661 times
2 Answers
0
You can use a jQuery image preloader.
There are some plug-ins already out there: http://farinspace.com/jquery-image-preload-plugin/
But you may want to roll your own: http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript

attack
- 1,523
- 12
- 17
-
how to fire some event when all images are loaded? – coure2011 Aug 15 '10 at 07:24
-
The jQuery image preloader (top link) has a callback event ('all') that triggers when all of the images have preloaded. – attack Aug 15 '10 at 19:36
0
[From the previous experience of mine]
I think its not a good Idea to preload
or load all 30-40 images at once. Because It makes the web server very busy to handle the request. What about the people having very slow Internet Connection ? more over when you want your slideshow begin only after all images are loaded, the user may or may not stay on your page until all your the images are loaded. I suggest you do some thing like,
lets assume that your Slide show consists of 40 Images,
Preload the first 10 Images and let the slide show begin,
when the slide show is in process,
send a Asynch request or what ever and download the remaining content.
I guess this is an efficient way than loading all Images at once