Jump to content
Search Community

draggable slider issue (when more than one slider on page)

michael_feh test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

We love helping with GSAP-related questions, but unfortunately we just don't have the resources to provide free general consulting, logic troubleshooting, or "how do I recreate this cool effect I saw on another site?" tutorials. Of course anyone else is welcome to post an answer - we just want to manage expectations.  

 

You are welcome to post in the "Jobs & Freelance" forum for paid consulting, or contact us directly. 

 

Otherwise, if you've got a GSAP-specific question just post that here along with a minimal demo and we'd be happy to take a look. 

Link to comment
Share on other sites

  • Solution

Hi,

 

I believe that the logic you're using in your Draggable instance could be the cause of all this. Honestly if you want to snap and you're using the Inertia Plugin, why not let the plugin do the heavy lifting for you? Is super simple:

See the Pen bGJpOoQ by GreenSock (@GreenSock) on CodePen

 

When using the Inertia Plugin you can add a snap callback in your Draggable config object, that particular function has one parameter, the end value calculated by the Inertia Plugin. You can use that in combination with the snap utility method and it will always land in a card.

 

Hopefully this helps.

Happy Tweening!

 

Link to comment
Share on other sites

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...