...

View Full Version : preloading with a loop



scriptkeeper
06-02-2003, 03:00 AM
Well as I'm sure I've said this before but I am working on a slide show and have hit a wall! I am using a loop to prelaod the images
and the image source itself.


pix=[];
for(i=0,j=1;i<42,j<43;j++,i++){
pix[i]=new Image();
pix[i].src=((j<10)?"000":"00")+j+".jpg";}



The problem that I am having is that its still loading images even though they are preloaded(or so I think?).But I may be wrong I am just basing this on the fact that every time it changes an images the cursor changes to hourglass? I not quite sure what to think? Heres a link to the slideshow. Thanx for the help!
SlideShow (http://209.210.25.172/SlideShow/Copy%20of%20slideShow.html)

glenngv
06-02-2003, 03:16 AM
maybe the browser is set to check for newer versions on "Every visit to the page", I don't know if that has something to do with image preloads..

just want to comment on your use of 2 iterators.
well, you can use a single iterator...

pix=[];
for(i=0;i<42;i++){
pix[i]=new Image();
pix[i].src=(((i+1)<10)?"000":"00")+(i+1)+".jpg";}

scriptkeeper
06-02-2003, 03:49 AM
Good idea but a quick qusetion. What kind of difference would removing the second iterator?

MotherNatrsSon
06-02-2003, 04:00 AM
I looked at your page and it sems to work fine. The only thing that did not appear to work is the "fade". MAC IE 5 and Netcape 7.........

MNS

glenngv
06-02-2003, 04:27 AM
Originally posted by scriptkeeper
Good idea but a quick qusetion. What kind of difference would removing the second iterator?

obviously faster since only 1 variable will be evaluated and incremented



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum