Results 1 to 9 of 9

Thread: Returning to first slide in slideshow

  1. #1
    Join Date
    Jul 2010
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Returning to first slide in slideshow

    1) Script Title: Swiss Army Slide show

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

    3) Describe problem: How do I go about having the slide show return to the first slide after it has looped through once?

    Thanks.

    Manuel A. Ayala

  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

    That's what it does. Do you mean something else, like perhaps after returning to the first image it also stops?

    This script can be setup so many ways, looping back to the first slide and stopping would require some modification or added code other than the configuration options though.

    If that's what you want, this show already does that:

    http://www.dynamicdrive.com/dynamici...nslideshow.htm

    But Swiss Army can be modified/added to for that as well, if for some reason this other script can't do what you want in other ways, though I find that hard to imagine. Though written very differently, the overlap of capabilities is astounding between the two.
    - John
    ________________________

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

  3. #3
    Join Date
    Jul 2010
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    John-

    I would like to continue using the Swiss army slide show since I have coded a great number pages with it. At this point I am also very comfortable with the code structure. As a work around, I thought of adding the first slide to the end of the show which I suspect would work but it work add another slide number to the counter which is not elegant. Thanks for you help.

    Manuel

  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

    I'm still not clear on what you're doing. The Swiss Army slide show is either continuous, manual, or a combination (switching between modes via user interaction). It has no configuration option to stop at a particular spot. If you have that, you have a (probably slightly) modified version (perhaps one I provided in these forums).

    However, if you are using the standard version of the script, it will return to the beginning after the last image, regardless of whether it is in manual or automatic mode.

    If, on the other hand, you have a modified version that stops at the end, it could easily be modified to return to the beginning. If that's the case though, I'd want to see the modified version you are using to best advise you as to how to get it to do that. In that case, please provide a link to a page using it.
    - John
    ________________________

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

  5. #5
    Join Date
    Jul 2010
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi John-

    I found on a previous posting the code modifications needed to have the slide run through automatically and stop on the last slide. This feature is working beautifully. Now the only modification I would like to make is have it return to the first image in the slide show as the last step. I not really interested in having it run continuously at this point. Thank you.

    Manuel

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

    What previous posting (link to it please)?

    To best assist you I would either need to see that, or the code you are using (paste it to your response).

    The easiest thing would probably be a link to your page (put the link in your response).

    Please supply one of these three things.
    - John
    ________________________

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

  7. #7
    Join Date
    Jul 2010
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi John-

    The section of code I modified is below. I remember reading it on an earlier post, but I think that you must have incorporated these modifications in your latest update. I am not completely sure. I did update to your latest swissarmy.js file. Thanks. Manuel

    Code:
    inter_slide.prototype.changeimg=function(bool,nav){
    if(this.playing){
    this.buttons(false)
    this.nextimgidx=(this.keeptrack()<this.imgs.length-1)? this.keeptrack()+1 : 0
    if(this.once&&this.nextimgidx==0&&!this.goagain){
    var but=this.go('gostp'+this.issid)? this.go('gostp'+this.issid) : '';
    this.gostop(but);
    this.goagain=1
    return;
    }
    this.goagain=0
    this.populateslide(this.tempobj, this.nextimgidx)
    if(bool)
    this.rotateimg()
    else{
    clearTimeout(this.inprocess)
    this.inprocess=setTimeout("iss["+this.issid+"].rotateimg()", this.delay)
    }
    }
    Last edited by jscheuer1; 08-06-2010 at 02:43 PM. Reason: format code

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

    That's not the extent of the modifications for the once only version of this script. The main function has to have the this.once=slides.once code in it (yours must already if it stops on the last), and you must use the sldies.once=1 (or true or something like that in the initialization, again - you must already have that). Or, if you don't have these additional code changes, they are hard coded into your version of the script in some other way. I do recognize it though as one that I authored somewhere in these forums. However, as far as I know, it has never been published even as a semi-official update. If you updated, I think you probably added the once only modifications to the update. The only semi-official update is introduced here:

    http://www.dynamicdrive.com/forums/blog.php?b=18

    and does not have these modifications, though I'm thinking of adding them.

    I've done tons of mods for this and other scripts. Please forgive me if I can't always keep track of each one.

    Anyways, all you need to do to get it to return to the first slide and then stop is make some changes to the code you show, here (as highlighted):

    Code:
    inter_slide.prototype.changeimg=function(bool,nav){
    if(this.playing){
    this.buttons(false)
    this.nextimgidx=(this.keeptrack()<this.imgs.length-1)? this.keeptrack()+1 : 0
    if(this.once&&this.nextimgidx==1&&this.goagain&&this.goagain<2){
    var but=this.go('gostp'+this.issid)? this.go('gostp'+this.issid) : '';
    this.gostop(but);
    ++this.goagain
    return;
    }
    this.goagain=this.goagain||1;
    this.populateslide(this.tempobj, this.nextimgidx)
    if(bool)
    this.rotateimg()
    else{
    clearTimeout(this.inprocess)
    this.inprocess=setTimeout("iss["+this.issid+"].rotateimg()", this.delay)
    }
    }
    Edit: I've added modifications to the blog update to allow for once only stopping at either the last or first slide
    Last edited by jscheuer1; 08-06-2010 at 04:41 PM. Reason: format code
    - John
    ________________________

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

  9. #9
    Join Date
    Jul 2010
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    John-

    That works great. Thanks a mil.

    Manuel

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
  •