Slick Slider slickGoTo method breaking the carousel

前端 未结 3 1992
庸人自扰
庸人自扰 2021-02-20 10:41

I\'m working on a news article page that also has a gallery of images. I\'m using slick slider for the thumbnails on the gallery. Every image in the gallery has it\'s own url f

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-20 11:15

    The solution that I have found working is to change the infinite to true

    $('.gallery-thumbs').slick({
      slidesToShow: 5, slidesToScroll: 5, dots: false, infinite: true, speed: 300, responsive: 
      [ 
        { breakpoint: 1024, settings: { slidesToShow: 5, slidesToScroll: 5 } },
        { breakpoint: 600, settings: { slidesToShow: 4, slidesToScroll: 4 } },
        { breakpoint: 438, settings: { slidesToShow: 3, slidesToScroll: 3 } },
        { breakpoint: 270, settings: { slidesToShow: 2, slidesToScroll: 2 } } 
      ] 
    });
    

    I know that the post is 3 years old, but I had to post a workaround solution.

提交回复
热议问题