Preloading images with Prototype/Scriptaculous
I'm using Prototype/Scriptaculous library for a featured content slider, it works great bu开发者_运维问答t the images need to be preloaded.
I've used jQuery mostly so I'm not sure how its done with Prototype. Here's the slider script if you'd like to take a look.
You can do this with a few simple lines of Javascript
var preload = []
for(var x=0;x<slider_images.length;x++) {
preload[x] = new Image()
preload[x].src = slider_images[x]
}
精彩评论