naver / egjs-flicking

🎠 ♻️ Everyday 30 million people experience. It's reliable, flexible and extendable carousel.
https://naver.github.io/egjs-flicking/
MIT License
2.75k stars 128 forks source link

Any way to define a minimum number of panels to swipe? moveCount? #838

Open TheGameKnave opened 10 months ago

TheGameKnave commented 10 months ago

Description

I'd like to be able to swipe 2 panels at once in some circumstances; I have a page view with a large panel and 2 half-panels on either side. I'd like to swipe from one side to the other without an awkward land in the middle. I see that moveCount is an option for a nav-button plugin, but doesn't seem to be available for vanilla.

malangfox commented 10 months ago

Hello @TheGameKnave.

There is no option to define a minimum number of panels to move when snapping. However, it seems that we can implement it through the willChange event.

There are two demos, following what you left in the issue. demo 1 - at least two panels move by swiping demo 2 - at least two panels move by swiping when the drag starts outside of the center panel.

If this implementation isn't what you had in mind, or if you have additional questions, please feel free to leave a comment!