PDA

View Full Version : Multiple slideshows on same page won't always start from 1st slide



fraser1
02-09-2011, 05:18 PM
1) Script Title: fadeslideshow

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem: I have multiple slide shows on the same page each one activated by its own button. All appear in the same place on the page in its own div, which are all hidden. I'm using show/hide to display the relevant slideshow.
All works fine and when you first open a slideshow it starts from the first slide, but if you return to the same slideshow it doesn't start from the beginning. I have persist: set to false and displaymode: to auto.
Is it possible to have the slideshows always start from the first slide even if they have been visited before during the same page view?:confused:

azoomer
02-09-2011, 09:24 PM
If you could attach something like this:

onclick="mygallery.navigate(0);

to the show/hide button it should navigate to the first slide when clicked

(try to make a search for onclick="mygallery.navigate(0); on dynamic drive, there are a lot of posts explaining it)

fraser1
02-10-2011, 09:58 AM
Thanks for that. It seems to work fine for a manual slideshow, starts on the 1st slide then clicks through each slide but on auto it starts on the 1st slide ok but then won't run.

Is there anything I should add to onclick="mygallery.setting.nav(0); to make it run on auto?

I apologize if I'm missing something, this is all pretty new to me.

azoomer
02-10-2011, 11:23 AM
I'm not sure, but i think what I did was to change this part of the fadeslideshow.js


fadeSlideShow.prototype={

navigate:function(keyword){
var setting=this.setting
clearTimeout(setting.playtimer)
if (setting.displaymode.type=="auto"){ //in auto mode
setting.displaymode.type="auto" //switch to "manual" mode when nav buttons are clicked on
setting.displaymode.wraparound=true //set wraparound option to true
}
if (!isNaN(parseInt(keyword))){ //go to specific slide?
this.showslide(parseInt(keyword))
}
else if (/(prev)|(next)/i.test(keyword)){ //go back or forth inside slide?
this.showslide(keyword.toLowerCase())
}
},

The red "auto" was changed from manual, and I think this will make the slideshow continue in auto mode. It should be around line 124 in the fadeslideshow.js

fraser1
02-10-2011, 11:45 AM
Yep, That's got it! Ain't life simple when you know the answer?

Thanks a million, that's absolutely fantastic.:)