Slick Slider slickGoTo method breaking the carousel

前端 未结 3 1977
庸人自扰
庸人自扰 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.

    0 讨论(0)
  • 2021-02-20 11:22

    Its is working. code: $('.firstDiv').slickGoTo(4);

    Please see below example

    http://jsfiddle.net/9fnmegqb/

    And as of version 1.4+ : $('.firstDiv').slick('slickGoTo', 4)

    0 讨论(0)
  • 2021-02-20 11:31

    As of version 1.4, the methods to invoke actions have changed.

    The equivalent code line for the slickGoTo() function is $('#slider_selector_id').slick('slickGoTo', slide_number);

    (where #slick_selector_id is the id for the slider, and slide_number is an integer of the slide index required)

    (answer from comment as suggested by Alexandre Bourlier in response to the another answer here)

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