FrEZ Posted January 22, 2023 Share Posted January 22, 2023 Hello, I am trying to make the carousel snap to the closest position after drag and spin to the corresponding position by pressing the li elements, but can't seem to figure out how to do it. Could I get some help? Thanks in advance! See the Pen OJwQRWa by FrEZy (@FrEZy) on CodePen Link to comment Share on other sites More sharing options...
Cassie Posted January 22, 2023 Share Posted January 22, 2023 Hi there! Here's a possibility? You could tween the progress of the animation. I just added a random position in here, you'd have to work out the positions and add the correct numbers in for each event listener! See the Pen KKBQWbV?editors=0011 by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
FrEZ Posted January 22, 2023 Author Share Posted January 22, 2023 16 minutes ago, Cassie said: Hi there! Here's a possibility? You could tween the progress of the animation. I just added a random position in here, you'd have to work out the positions and add the correct numbers in for each event listener! Can't I use the snap method somehow? Link to comment Share on other sites More sharing options...
Cassie Posted January 22, 2023 Share Posted January 22, 2023 Well these are two separate questions really.- snap to the closest position after drag - spin to the corresponding position by pressing the li elements I'm not all too sure how to help with snapping to a card after throwing. Maybe someone else can jump in! Link to comment Share on other sites More sharing options...
FrEZ Posted January 24, 2023 Author Share Posted January 24, 2023 On 1/23/2023 at 2:58 AM, Cassie said: Well these are two separate questions really.- snap to the closest position after drag - spin to the corresponding position by pressing the li elements I'm not all too sure how to help with snapping to a card after throwing. Maybe someone else can jump in! I opened a new topic because I explained the problem more in detail there. Also I didn't get an answer here. I will ask once again, can you please not close my topic? It's not a duplicate as it is a different codepen with a similar issue, but not quite the same as it goes into more detail. Take care! Link to comment Share on other sites More sharing options...
Cassie Posted January 24, 2023 Share Posted January 24, 2023 Alright - I'll unlock it but please be mindful of creating duplicates going forward! We don't have many people helping in here so we have to be careful about wasting effort. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now