Jump to content


draggable, snap and ThrowProps

Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts



If you try this pen you will find a tiny bug when you click few milliseconds before the end of the snap, the drag doesn't works and it's hard to get it back.

How to remove this? There is something to stop on click but I need to keep position.

See the Pen BPrWJY by anon (@anon) on CodePen

Link to comment
Share on other sites

It was really hard to debug your example as you were performing some calculations onDrag which was re-positioning element at random position. That being said, what you are doing, I have done that countless times and I have never faced such issue. In which browser are you experiencing it? I didn't notice behavior you are experiencing.


I looked further into it, at first I was going to say I am experiencing same behavior but I think you are dragging your Draggable of type 'x' vertically so it doesn't move. But if you drag it horizontally it behaves correctly.


See the Pen vaRjvZ?editors=0010 by Sahil89 (@Sahil89) on CodePen



  • Like 3
Link to comment
Share on other sites

My real page (not this demo) is more complexe, my external screen is big and my MacBook from 2013 :(
I remove some transform inside the slide (change to ugly margin-top) and it's look better :-|


Link to comment
Share on other sites

Well maybe start with something simple and then build on top of it. Simple examples are really good way to understand something more efficiently. Not sure if it will help but in first few minutes in following video I have explained how Draggable works.



  • Like 3
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.