当我初始化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