slick: When `centerMode` is set to true the `slidesToScroll` property setting is ignored.
Description
When centerMode
is set to true the slidesToScroll
property setting is ignored.
JSFiddle
http://jsfiddle.net/whoacowboy/g2sozm65/1/
Steps to reproduce
- Using the centerMode code from you demo page create a jsfiddle
- Add the
slidesToScroll:3
to you properties, hit run
Expected behavior
I would expect the carousel to slide 3 slides when i hit the arrow or swipe the carousel.
Observed behavior
The carousel slides only one slide.
More Details
- Which browsers/versions does it happen on? Chrome, FF, Safari Latest
- Which jQuery/Slick version are you using? 1.6.0
- Did this work before? ?
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 10
- Comments: 37
Commits related to this issue
- Do not set slidesToScroll when centerMode is true. Resolves https://github.com/kenwheeler/slick/issues/2328. — committed to ryanpcmcquen/slick by deleted user 6 years ago
- Fix for https://github.com/kenwheeler/slick/issues/2328 — committed to Dunnymeister/slick by Dunnymeister 6 years ago
If you want to force the use of slidesToShow with centerMode, you do not need to change the core code. I did it like this :
This works for me but please notice :
Could you please remove that check? I think if we notice something wrong when using
centerMode
we can just setslideToScroll=1
ourselves.@AlexeyJersey It’s 2021. Slick died three years ago. Don’t use it.
I also had to move to another slider to support more native touch usage like momentum scrolling: https://swiperjs.com/
Nonetheless, I have a PR out there if anyone cares to 👍 it or whatever: https://github.com/kenwheeler/slick/pull/3513
Hey guys I just wanted to share that I have found a slider that has all the features that Slick has and it works great in my personal developing experience. https://flickity.metafizzy.co/ You might want to check it out, I hope you will find this helpful. Nonetheless, Slick is great, but it has some flaws (for example, you cant really slide multiple items all at one time, depends on the amount of user interaction - how much he scrolled). so Slick will go only 1 slide or 2 slides each time. it wont be dynamic.
@leggomuhgreggo For the most part it works. I have noticed that it using
gets out of sync.
@kenwheeler, happy to check this out and see if I can come up with a fix, love to gets your thoughts before I beat myself to death with my monitor trying to figure it out.