DEV Community

Discussion on: How to Handle Swipe Event on React Carousel

Collapse
 
lursmani profile image
Lursmani

Hey there! Very cool guide, did a version of it myself where the slides transition at the end of the swipe, not during.

I have a question: Would you have an idea on how to make this slide follow your finger and then snap to the next picture that is in view? Like the instagram carousel, for example.

The finger-following is easy, I just changed .carousel-content-wrapper's overflow property to "scroll" from "hidden", but now the slide transitions the distance that you swipe + the original distance. Is there a way to make it that the total distance transitioned is equal to one picture, no matter how far you swipe?