[Help]: Limit number of scroll snaps at any screen size #731
-
SummaryHi there, I'm trying to implement a version of the carousel that only shows a max of 5 scroll snaps at any screen size to limit scroll fatigue for our use case. I see it's technically possible with the dot navigation (though the last slide gets cut off if there's overflow) by slicing the array from If applicable, which variants of Embla Carousel are relevant to this question?
Additional informationNo response CodeSandbox exampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
@alexandra-lim thank you for your question. I’m not 100% sure that I get the question, but have you tried using Let me know if this is what you’re looking for. Best, |
Beta Was this translation helpful? Give feedback.
Hi @alexandra-lim,
I see. No, there's no built-in way to do this. You have to add that logic yourself. One thing that comes to mind is that you can add a class name to all "wanted" slides and then select them with the slides option:
This way, "unwanted" slides won't be included when Embla calculates stuff. I h…