iDangero.us Swiper multiple instances

前端 未结 1 1037
长情又很酷
长情又很酷 2021-01-14 02:32

I\'m trying to add multiple swipers (http://www.idangero.us/swiper/) on my site. I want to add the swipers dynamic so i use the same class for every swiper. Each swiper look

相关标签:
1条回答
  • 2021-01-14 02:53

    you need to do something like:

    $('.swiper-container').each(function(){
        new Swiper($(this), {
            pagination: $(this).find('.swiper-pagination'),
            paginationClickable: $(this).find('.swiper-pagination'),
            nextButton: $(this).find('.swiper-button-next'),
            prevButton: $(this).find('.swiper-button-prev'),
            loop: true
        });
    });
    

    0 讨论(0)
提交回复
热议问题