Preloading images with Prototype/Scriptaculous

1.1k views Asked by At

I'm using Prototype/Scriptaculous library for a featured content slider, it works great but 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.

1

There are 1 answers

0
Diodeus - James MacFarlane On BEST ANSWER

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]
}