Results 1 to 5 of 5

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

  1. #1
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ultimate Fade-in slideshow (v1.5) - Update content with ajax?

    hi!

    i'm using this script to show some pictures in a slideshow:
    http://www.dynamicdrive.com/dynamici...nslideshow.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

  2. #2
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i've tried to use the function provided here:
    http://www.dynamicdrive.com/forums/s...ead.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?

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by badtant
    i've tried to use the function provided here:
    http://www.dynamicdrive.com/forums/s...ead.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 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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    managed to solve it, thanks =)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •