Jump to content
Search Community

Recommended Posts

syntheticmachine
Posted

I'm trying to get this carousel to be infinite, but still snap in place. Right now it gets to the last slide and scrolls back to the first one. How would I achieve that? It seems like the issue only happens when dragging.

See the Pen RNPzqZb by syntheticmachine (@syntheticmachine) on CodePen.

Posted

Hi,

 

I'm not 100% sure about what you're trying to achieve here, but maybe something like this, using some callbacks like onDragStart and onThrowComplete:

See the Pen KwdPqJm by GreenSock (@GreenSock) on CodePen.

 

Also this demo uses GSAP DelayedCall instead of a setInterval timer, like that you can easily pause the timer while dragging and restart it when the inertia throw is completed. Also that allows to update the rotation in order to keep everything in sync.

 

Hopefully this helps

Happy Tweening!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...