开发者

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜