mooHorizonSlider
May 20, 2008 · Print This Article
this little slider class is build with the mootools framework 1.11. You can define various things:
* single image movement left / right
* multiple movement left / right
* scroll speed
* image container
* image size
In conjunction with the needed CSS style for the scroller, it creates an easy to use image slider. The slider class can be adjusted to fit your needs perfectly - imageWidth, imageCount, scrollRanges etc.
Check out the source of this page to see how it is implemented. You can also use this line of code, adjust it to your needs, copy the CSS to your file and get it going:
var p = new avScroll({container:’innerScroller’, imgWidth:233, scrollRange:24, leftHandle:’leftClicker’,rightHandle:’rightScroller’, rw:’leftFF’, ff:’rightFF’, speed:700});
Check it out here: moo horizontal slider




Is there an easy implementation to make this class stop at both ends, when it reaches the ends. Both with the single and multiple movement?
pls how to exactly use this script from the comment to stop on the right side. because its not working.
Actually I am too busy, but if you have some time and be patient, I’ll come up with a solution and post it here.
Thanks I’ll be waitting. It’s very nice script, only this bug ..
This works. Its not the most optimized but works well. All the 4 : the left, right, fast forward and rewind work.
leftClick: function(){
if(this.leftClicks > 0){
var start= this.leftClicks * this.imgWidth;
var end = ( this.leftClicks - 1 ) * this.imgWidth;
$(this.container).effect(’right’,{ duration: this.speed, wait:true, transition:Fx.Transitions.Back.easeIn }).start(start,end);
this.leftClicks–;
}
},
rightClick: function(){
var start= this.leftClicks * this.imgWidth;
var end = (this.leftClicks * this.imgWidth) + this.imgWidth;
if(end < this.scrollRange) {
$(this.container).effect(’right’,{ duration: this.speed, wait:true, transition: Fx.Transitions.Back.easeIn }).start(start,end);
this.leftClicks++;
}
},
fastForward: function(){
// scroll 4 images to the right, calculate it on base of the clicks and the image width
var start= (this.leftClicks) * this.imgWidth;
var end = (( this.leftClicks + 4 ) * this.imgWidth);
if(end 0){
var start= (this.leftClicks * this.imgWidth );
if(this.leftClicks < 4){
this.leftClicks = 4;
}
var end = ((this.leftClicks - 4 ) * this.imgWidth);
$(this.container).effect(’right’,{ duration: this.speed, wait:true, transition: Fx.Transitions.Back.easeIn }).start(start,end);
this.leftClicks-= 4;
}
}