2010-06-19 71 views
0

我想要一個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
}
});
jCarouselLite:如何獲取當前顯示圖像的值?

回答

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 + ""); 
    } 
});