Can you control when to precache images? - TechRepublic
General discussion
October 2, 2002 at 04:49 AM
iclang

Can you control when to precache images?

by iclang . Updated 23 years, 9 months ago

I have a page that requires precaching of images and I want to be able to precache one at a time… after each one is done, it goes to the next and begins precaching, and so on…

Has anyone successfully done this or have any ideas? I’ve tried: (not actual code but close!)

var theImages = new Array()

theImages[i] = new Image();
theImages[i].src = “photo”+x+”.jpg”
theImages[i].onload = [do it again with next image]

But with no luck.

thanks!

This discussion is locked

All Comments