to GoTo a specific slide by index number
new function
Code:
goto:function(nu){
var o=this;
if (typeof(nu)=='number'&&nu>=0&&nu<o.$imageslides.length){
clearTimeout(o.rotatetimer);
o.setting.displaymode.stoponclick=true;
o.navigate(nu>=o.curslide?'forth':'back',nu);
}
},
modify function
Code:
navigate:function(keyword,nu){ //keyword: "back" or "forth"
var slideshow=this, setting=this.setting
clearTimeout(this.rotatetimer)
if (!setting.displaymode.stoponclick && setting.displaymode.type!="manual"){ //if slider should continue auto rotating after nav buttons are clicked on
this.curstep=(keyword=="back")? this.curstep-1 : this.curstep+1 //move curstep counter explicitly back or forth depending on direction of slide
this.rotatetimer=setTimeout(function(){slideshow.rotate()}, setting.displaymode.pause)
}
var dir=(keyword=="back")? (setting.orientation=="h"? "right" : "down") : (setting.orientation=="h"? "left" : "up")
var targetslide=(keyword=="back")? this.curslide-1 : this.curslide+1
targetslide=(targetslide<0)? this.$imageslides.length-1 : (targetslide>this.$imageslides.length-1)? 0 : targetslide //wrap around
typeof(nu)=='number'?targetslide=nu:null;
if (this.animation_isrunning==false)
this.slide(targetslide, dir)
},
to call
Code:
<input type="button" name="" value="Goto 0" onmouseup="firstbgcarousel.goto(0);"/>
<input type="button" name="" value="Goto 1" onmouseup="firstbgcarousel.goto(1);"/>
<input type="button" name="" value="Goto 2" onmouseup="firstbgcarousel.goto(2);"/>
<input type="button" name="" value="Goto 3" onmouseup="firstbgcarousel.goto(3);"/>
where the buttons are your thumbnail images
and firstbgcarousel if the global variable var firstbgcarousel=new bgCarousel({
or with integrated pagination see
http://www.vicsjavascripts.org.uk/Sl...ideShowIII.htm
Bookmarks