mr__brainwash
mr__brainwash

Reputation: 1382

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
    });

Upvotes: 3

Views: 22430

Answers (2)

Flavius-Calin Tofan
Flavius-Calin Tofan

Reputation: 11

swipeToSlide: true

Adding swipeToSlide option does the job, even with slidesToScroll enabled. No need to disable slidesToScroll.

Upvotes: 0

Asaf David
Asaf David

Reputation: 3297

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.

Upvotes: 14

Related Questions