Jump to content
GreenSock

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

How to stop work of Inertia plugin?

Recommended Posts

Hello, it's me again with GSAP 3 migration :)

I have a case, when I check Draggable's endX and if it is smaller than I need I return the dragged object back to original position.

In the previous version of GSAP, when I applied TweenMax.to to the dragged object it "rewrote" the Draggable's behaviour and did what I want.

But now, after gsap.to finishes its animation the Draggable continues its work and places object into the endX coordinate.

 

Please, help. I couldn't find a proper "stop" method for Inertia in the Docs.

 

See the Pen oNgLBJX by nordskill (@nordskill) on CodePen

Link to post
Share on other sites

It works. Thank you, @OSUblake!

By the way, I had a mistake in this line  if (this.endX < 300 || this.endX > -300) { previously. There should be &&. But it's fine — the issue is still reproducible.

Link to post
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.

×