Progressive Image Load and Switch
Posted on 2004-09-30
I am trying to design some code to accomplish the following
* I have a list of images to be loaded, some of which are large
* assume a slow connection
* as each image is loaded I want it placed in another array which is cycled through on a timer and displayed in another window (the same window for all images). So, this array gets bigger as each of the images arrive. So, when we have only 1 image, this just stays there unchanging. If we have 2 images (A and B) and the timer interval is 20 seconds, we would see A B A in the first minute, assuming C has not arrived. If C arrives any time during the first display of A or B then we would see A B C in the first minute.
I imagine this can be accomplished using the onload method of the Image object and the settimeout (or is it SetTimeout?) method of window (or Window? .. this case sensitivity is driving me nuts) .. but I am a js novice, so code that puts it all together would be nice