开发者

Preloading images with Prototype/Scriptaculous

开发者 https://www.devze.com 2023-02-09 03:05 出处:网络
I\'m using Prototype/Scriptaculous library for a featured content slider, it works great bu开发者_运维问答t the images need to be preloaded.

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

精彩评论

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