PDA

View Full Version : Returning to first slide in slideshow



ma-chino
08-05-2010, 06:04 PM
1) Script Title: Swiss Army Slide show

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/swissarmy/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

jscheuer1
08-05-2010, 06:48 PM
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/dynamicindex14/fadeinslideshow.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.

ma-chino
08-05-2010, 08:12 PM
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

jscheuer1
08-05-2010, 11:45 PM
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.

ma-chino
08-06-2010, 01:35 AM
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

jscheuer1
08-06-2010, 03:28 AM
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.

ma-chino
08-06-2010, 02:26 PM
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


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)
}
}

jscheuer1
08-06-2010, 04:03 PM
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):


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)
}
}

I've added modifications to the blog update to allow for once only stopping at either the last or first slide

ma-chino
08-06-2010, 04:25 PM
John-

That works great. Thanks a mil.

Manuel