Connecting Tech Pros Worldwide Help | Site Map

How to make slide show load faster?

Member
 
Join Date: Aug 2007
Posts: 119
#1: Jul 13 '08
Is there any way to make this site load faster? I'm pre-loading the slide-show images into an array, the biggest one is 80KB and still it takes a few seconds before the first image becomes visible. Is there anything else I can do to speed things up?
hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,609
#2: Jul 14 '08

re: How to make slide show load faster?


Well, I think that depends upon the downloading speed and has nothing to do with the HTML.
But you can try one thing. Keep all the images (<img>) inside your HTML, inside a div with style="display:none;". See if it works.
Member
 
Join Date: Aug 2007
Posts: 119
#3: Jul 14 '08

re: How to make slide show load faster?


Instead of pre-loading the images into an array?? Wouldn't that make it slower?
hsriat's Avatar
Expert
 
Join Date: Jan 2008
Location: Bath, UK
Posts: 1,609
#4: Jul 14 '08

re: How to make slide show load faster?


When in an array, they are actually fetched from the server only when its their turn. But if you will add them inside the HTML with display:none, the images would get cached. And moreover the window.onload event would be fired after the images are cached.

So on one hand you can say it will slow it down, since onload is being fired after all images are loaded. But on the other hand, it would improve the speed of the slide show as all the images would have been cached before being displayed.
Member
 
Join Date: Aug 2007
Posts: 119
#5: Jul 15 '08

re: How to make slide show load faster?


I think I see what you're saying. I'll give it a try and let you know how it works. Thanks!!
Reply