A smooth carousel in central mode triggers slides. Toscroll does not work, as it should be.

In slick carousel (Slick.js), I would like to use centerPadding, so I need to set centerMode to true. After turning CenterMode on, I scroll through the slides, but it only moves one slide per swipe, no matter how hard I drag the carousel from side to side. If I change centerMode to false, the carousel works correctly, but centerPadding does not work.

In summary
centerMode: true // Turn this value to false, then slideToScoll works, but centerPadding does not work
centerPadding: "30px" // Work only if centerMode is true
slideToScroll: 3 // This doesn’t work, only 1 slide slide for swipe

I want these slicks carousel options to work together, centerMode with CenterPadding and the number of slideToScroll jobs as indicated.

Is it possible?

+5
source share
1 answer

If I understand your problem correctly, this can be solved using:

swipeToSlide: true

in settings.

This will cause the swipe / drag to stop on the slide you were actually scrolling on, and not on the next slide.

But there is no way to make certerMode and slideToScroll to work simultaneously.

0
source

Source: https://habr.com/ru/post/1238365/


All Articles