スクリプトの修正を手伝ってください: http://jsfiddle.net/b36cM/
if(direction == -1){
wrapperElements.children(':last').after($('#carousel > ul').children().slice(0, options.rotateBy).clone());
shiftAction();
wrapperElements.children().slice(0, options.rotateBy).remove();
}
else{
// wrapperElements.children(':first').after($('#carousel > ul').children().slice(carouselLength - options.rotateBy, carouselLength).clone());
// shiftAction();
// wrapperElements.children().slice(carouselLength - options.rotateBy, carouselLength).remove();
}
}
function shiftAction(){
console.log(offset);
wrapperElements.animate({
'left': offset
}, options.speed, function(){
running = false;
});
}
}
アニメーションをクリックすると#prev
、2 つの要素が左にシフトします。1項目だけスムーズにスクロールしたい。