View Full Version : Refreshing preloaded images in a slideshow

11-14-2004, 07:41 AM
I'm using the slideshow script from CodeLifter.
It preloads all images in an array first :

var Picture = new Array();
Picture[1] = 'img/slide.php?slide=a1';
Picture[2] = 'img/slide.php?slide=a2';

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

But since the slides are server-side GD generated pictures, I'm looking for a way to refresh all the preloaded images after a full slideshow cycle.

This is the code that runs the slideshow. How must I change this code in order to have it refresh all the preloaded images after a full slideshow cycle ?

function runSlideShow(){
if (document.all){
document.images.PictureBox.src = preLoad[jss].src;
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);

All help is very much appreciated !


Bram van den Hout