javascriptjquerycssslick-2.0slick.js

Slick Slider slidesToScroll modification


I use the slick slider on my site. And no matter how much I was pulling the slider to the left or to the right, it just runs only on the number of slides that is specified in the property slidesToScroll. Is it possible to do something with slick slider that it worked like this slider http://www.owlcarousel.owlgraphic.com/demos/mousewheel.html. How much do you pulling - it scroll the same distance. Sorry for my english. Thanks you.

There is my code for init slick slide:

 $('.slider-wrapper-2').slick({
        slidesToShow: 4,
        slidesToScroll: 4,
        rows: 1
    });

Solution

  • Just add the swipeToSlide setting, which enables swiping to any slide irrespectively to slidesToScroll

    Your initializing script should look like this:

    $('.slider-wrapper-2').slick({
        slidesToShow: 4,
        slidesToScroll: 4,
        rows: 1,
        swipeToSlide: true
    });
    

    In case it doesn't work, remove the slidesToScroll option. Please comment how it worked so I can edit my answer.