Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

User-defined ease on Draggable with throwProps: true

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

Hi - brand new Shockingly Green member here and I'm playing around with the throwProps plugin. Really, really liking it so far, the work you guys do is really impressive. 


I'm having some trouble with a few customizations. In particular, I'd like to configure my Draggable (a "drawer") with throwProps: true so that the default ease is Expo.easeOut. I've toyed around with different ways to make this happen, but I'm not quite getting it. It's almost certainly due to my unfamiliarity with the plugin, so I thought I'd ask the pros. Thanks! 

See the Pen yregxq by phidur (@phidur) on CodePen

Link to comment
Share on other sites

Welcome to the club!


I'm not totally clear on what you're trying to do, but I assumed you wanted to make the drawer close completely if/when the user drags UP on it (at whatever velocity), and leverage ThrowPropsPlugin to match momentum. Here's a fork: 

See the Pen 72b9a589498447674b829089180e60db?editors=0010 by GreenSock (@GreenSock) on CodePen


And you can set an ease on the Draggable (it only affects throwProps tweens that it initiates). 


Does that help?

  • Like 2
Link to comment
Share on other sites

Great! Thanks for the response. I think this was the key piece that I was missing "y:{end:drawerY}". Works like a charm

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