PDA

View Full Version : Ultimate Fade-in slideshow (v1.5) - Update content with ajax?



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

badtant
04-25-2006, 08:49 AM
i've tried to use the function provided here:
http://www.dynamicdrive.com/forums/showthread.php?t=8158

the problem now is that it's still the old array that is beeing displayed.

i replace the array using ajax and then run the changeArray function. it runs but then it's still the old array displayed. i guess it's because my new array (from the ajax features) is just put in and never executed.

do you think this is the case? if so, how can i get it executed?

ddadmin
04-25-2006, 11:33 PM
Hmmm I haven't studied thoroughly John's code yet in that thread, though just to take one step back, what exactly are you using Ajax for in this case? To get a txt file that contains the names of the new images? It seems the problem is with your Ajax code, though without knowing more about what it does (a link would help), it's hard to provide any advise.

jscheuer1
04-26-2006, 07:39 AM
i've tried to use the function provided here:
http://www.dynamicdrive.com/forums/showthread.php?t=8158

the problem now is that it's still the old array that is beeing displayed.

i replace the array using ajax and then run the changeArray function. it runs but then it's still the old array displayed. i guess it's because my new array (from the ajax features) is just put in and never executed.

do you think this is the case? if so, how can i get it executed?

I did reply (http://www.dynamicdrive.com/forums/showpost.php?p=34003&postcount=7) in your other thread on this. Hopefully that will be illuminating for you. If not, a link to your problem page may allow us to assist you further.

badtant
04-26-2006, 01:10 PM
managed to solve it, thanks =)