-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manually update Carousel position #597
Comments
Hi, Could you share your progress using any code playground? Basically, Carousel uses Panzoom component under the hood, therefore you should interact with it. |
Here is one possible solution - https://jsfiddle.net/v1tjh6ma/ (this is for a vertically aligned carousel, but should be similar to a horizontal carousel). Sorry, custom animations or the wheel event were not considered beforehand when these components were built, therefore the solution is not that elegant. |
Yes, that's exactly what I was looking for. I didn't know Panzoom was what I needed to interact with but it opens a lot of possibilities. Thanks a lot. |
If you could update to the latest, you can do the following: myCarousel.container.addEventListener("wheel", (event) => {
myCarousel.panzoom?.applyChange({
panY: event.deltaY * -1,
});
myCarousel.setPageFromPosition()
}); |
Is your feature request related to a problem? Please describe.
I wrote a function that changes the Carousel position on scroll. However, when I then click on an arrow or drag the carousel (with dragFree set as true), the transition starts from the last position before the scroll.
Describe the solution you'd like
How can I manually update the value saved after scrolling / Where is it stored?
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: