Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slick carousel in Center Mode causes SlidesToscroll does not work as it should be

In slick carousel(Slick.js), I would like to use centerPadding so I have to set centerMode to true. After I turn CenterMode on, I swipe the slides but it moves just only one slide per swipe no matter how much I drag/swipe the carousel from side to side. If I change centerMode to false, the carousel works properly but centerPadding does not work.

In summary
centerMode: true //Turn this false then the slideToScoll works but centerPadding doesn't work
centerPadding: "30px" //Work only if centerMode is true
slideToScroll: 3 //This doesn't works, only 1 slide scroll per swipe

I want those options of slicks carousel works together, centerMode with CenterPadding and number of slideToScroll works as indicated.

Is that possible?

like image 994
Takumi Avatar asked Dec 16 '15 10:12

Takumi


People also ask

What is a slick carousel?

A slideshow component for cycling through elements—images or slides of text—like a carousel.

How do I add slick to Carousel?

Make a choice: https://cdnjs.com/libraries/slick-carousel. https://www.jsdelivr.com/projects/jquery.slick. Afterwards, simply insert the CSS as links into the HTML page head and the JavaScript just before your closing body tag.


1 Answers

if I understand your issue correctly, this can be resolved by using:

swipeToSlide: true

in your settings.

That will cause swipe/drag to stop on the slide you actually swiped to, rather than the next slide.

But there is no way to make certerMode and slideToScroll, both to work at the same time.

like image 166
viCky Avatar answered Oct 08 '22 12:10

viCky