Results 1 to 5 of 5

Thread: Ultimate fade-in slideshow modification: stop sliding

  1. #1
    Join Date
    Oct 2006
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Ultimate fade-in slideshow modification: stop sliding

    1) Script Title: Ultimate fade-in slideshow

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem: I'd like to modify the script so that it shows the whole array of images only once. I don't want it to repeat the images. When the last image appears, I'd like it to remain on the last one.

    I've put in my time trying to figure it out myself, but my coding days are obviously too far in my past and I'm rusty. Help please!

  2. #2
    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

    - John
    ________________________

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

  3. #3
    Join Date
    Oct 2006
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks, that's almost it! One small difference I need in the script, though.

    I don't want to end the slideshow on the first image - I want to end it on the last image.

  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

    Find this line:

    Code:
    obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
    if(obj.flag){
    obj.mouseclickcheck=1
    obj.flag=0
    }
    if(obj.nextimageindex==obj.postimages.length-1)
    obj.flag=1
    obj.populateslide(obj.tempobj, obj.nextimageindex)
    Make the 1 a 2:

    Code:
    if(obj.nextimageindex==obj.postimages.length-2)
    If you want to retain the ability of the user to start/restart the show with a click, find this line as well:

    Code:
    fadeshow.prototype.populateslide=function(picobj, picindex){
    var slideHTML=""
    if (picindex==this.theimages.length-1)
    slideHTML+='<img style="cursor:pointer;" title="Click to Start" src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
    else
    slideHTML+='<img title="" src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
    picobj.innerHTML=slideHTML
    Make it like so:

    Code:
    if (this.flag&&picindex==this.theimages.length-2|this.theimages.length-1)
    - John
    ________________________

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

  5. #5
    Join Date
    Oct 2006
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Awesome John, that did it! I played with it all day yesterday and had made some other fudgey changes (skipping the array shuffling at the beginning, starting on the first element of the array instead of the last) but there remained a flash of the last image at the beginning of the show.

    Thank you for taking the time and sharing your know-how.

    Andrea

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
  •