jCarouselLite:如何获取当前显示图像的值?

时间:2010-06-19 16:25:02

标签: jquery jcarousellite

我想要一个jCarouselLite图库作为滚动缩略图,并通过某种方式引用它当前显示的图像(然后通过数组或类似选择第一个图像)在它旁边显示一个更大的图像。我该如何处理?

目前的设置 -

$('.carousel').jCarouselLite({
btnNext: '.next',
btnPrev: '.previous',
auto: true,
timeout: 500,
speed: 500,
vertical: true,
visible: 3,
circular: true,
beforeStart: function(a) {
//alert("Before animation starts:" + a);
},
afterEnd: function(a) {
//fetch first image of the currently displayed images
//set html content of .display div to be that of the new image
}
});

1 个答案:

答案 0 :(得分:0)

这可能有所帮助 - Showing the position in jCarouselLite

您可以使用内置的afterEnd和beforeStart功能向您显示当前向用户显示的内容。

$(".ccvi-carousel").jCarouselLite({
    btnNext: ".next",
    btnPrev: ".prev",
    speed:  800,
    //auto: 2000,
    afterEnd: function(a) { 
        //look into the object and find the IDs of the list items
        left = $(a[0]).attr("id");
        mid = $(a[1]).attr("id");
        right = $(a[2]).attr("id");
        //Do something
        $('li#' + left + ' .cf-img').fadeIn();
        //alert("Left:" + left + "Middle:" + mid + "Right:" + right + "");
    }
});
相关问题