$indicator.html(indicatorHTML);
-
function goToSlide(index){
$slideGroup.animate({left:-100*index+'%'},duration,easing);
currentIndex = index;
$indicator.find('a').removeClass('active')
.eq(currentIndex).addClass('active');
}
-
- function startTimer(){
- timer = setInterval(function(){
- var nextIndex = (currentIndex+1) % slideCount;
- goToSlide(nextIndex);
- },interval);
- }
-
- function stopTimer(){
- clearInterval(timer);
- }
-
-
-
+
$nav.on('click','a',function(event){
event.preventDefault();
if ($(this).hasClass('prev')){
goToSlide($(this).index());
}
});
-
-
-
+
goToSlide(currentIndex);
-
-
+
});
});