簡體   English   中英

獲取 jCarouselLite 圖像/頁面的當前索引

[英]Get current index of jCarouselLite image/page

我已經查看了有關此問題的其他問題,但沒有找到合適的答案。

我需要的很簡單:當前顯示項目的索引。

這是我的一小部分配置

    $('.carousel').jCarouselLite(
    { 
        btnNext: "#right-navigation",
        btnPrev: "#left-navigation",
        visible: 1,
        afterEnd: function(a)
        {
            // Code that requires the index
        }
    });

注意: a是 object

謝謝!

表示 animation 結束后可見項目的元素作為參數傳入。

所以你應該能夠做類似的事情

afterEnd: function(a){
   var index = $(a[0]).index();
}

獲取第一個元素的索引

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM