badtant
04-25-2006, 06:29 AM
hi!
i'm using this script to show some pictures in a slideshow:
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm
now i want to update the content of my picture array after a certain amount of time. i'm doing it with some ajax-features which works just fine, but the problem is this:
this is the array where you specify the images:
fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax
fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image
this array is then copied into another one:
this.theimages=theimages
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
the array that i'm updating with ajax is "fadeimages" but this doesn't update the slideshow since the first fadeimages array has been copied to this.postimages. what can i do to get my new array into the slidshow? any idea of what i should add/change?
i don't need the feature to be able to have several slideshows on the same page (if that maybe can help me to get this working more easy).
i hope someone understands my problem and have an idea.
thanks!
/niklas
i'm using this script to show some pictures in a slideshow:
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm
now i want to update the content of my picture array after a certain amount of time. i'm doing it with some ajax-features which works just fine, but the problem is this:
this is the array where you specify the images:
fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax
fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image
this array is then copied into another one:
this.theimages=theimages
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
the array that i'm updating with ajax is "fadeimages" but this doesn't update the slideshow since the first fadeimages array has been copied to this.postimages. what can i do to get my new array into the slidshow? any idea of what i should add/change?
i don't need the feature to be able to have several slideshows on the same page (if that maybe can help me to get this working more easy).
i hope someone understands my problem and have an idea.
thanks!
/niklas