swiper获取当前的index ( loop=true时,)

//swiper 在loop=true时,获取当前的index
onSlideChangeEnd: function (swiper) {
    var index = $('.swiper-slide-active').attr('data-swiper-slide-index');
    //console.log(index);
    var title = $(".Jcase .swiper-container .slide-" + index).data("title");
    console.log(title)
    $('.Jcase .JlunboTxt').text(title);
}

 

posted @ 2020-12-08 10:10  吃剩的方便面  阅读(5233)  评论(0编辑  收藏  举报