Extends Fx.Scroll to provide carousel functionality.
HTML
#HTML
<div id="carousel">
<div class="inner" style="width: 2000px">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
</div>
CSS
#CSS
div#carousel {
overflow: hidden;
width: 300px;
height: 200px;
}
div#carousel div.inner {
width: 600px;
}
div#carousel div.inner > div {
float: left;
width: 100px;
height: 200px;
}
JS
#JS
myCarousel = new Fx.Scroll.Carousel('carousel',{
mode: 'horizontal',
onStart: function(){
myCarousel.getCurrent().tween('color','#000');
},
onComplete: function(){
myCarousel.getCurrent().tween('color','#fff');
}
});
myCarousel.toNext();
myCarousel.toPrevious();
myCarousel.getCurrent(); // returns an element
View the MooDoc for more detailed documentation.