當我初始化jCarousel Lite時,我希望能夠爲列表中的第一個元素添加'class ='active''狀態。我如何在不修改插件的情況下處理這個問題?將活動狀態添加到jCarousel Lite中的第一個項目
當前設置 -
$('#viewport').jCarouselLite({
speed: 500,
visible: 3,
scroll: 1,
start: 0, // Just for testing purposes
circular: true,
btnNext: '#next',
btnPrev: '#previous',
beforeStart: function(a) {
$(a[0]).animate({opacity: .5}, 250).toggleClass('active');
},
afterEnd: function(a) {
$(a[0]).animate({opacity: 1}, 500).toggleClass('active');
}
});
謝謝,這將不得不做,直到有一個內置的功能。 – 2012-04-09 10:54:43