Jump to content
GreenSock

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

Draggable snap function not called

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

There was a time when I used to have an SVG chart to be dragged along and snapping on the existing x values.

Had the ThrowProps to have a nice throwed slide along the x axis.

 

And it worked fine.

 

Since more than a week ago it just stopped to work properly. 

Neither the snap nor the throw props work.

The Snap  function for the x value - as I provide it - is not even called.

 

There is no exception thrown. It just doesn't do more than being draggable and only snaps to the bounds.

 

 

 

How might I debug that? I have no clue xD The problem simply cannot exist.

 

 

I could try to reproduce the problem in a codepen - just, how do I add the draggable and throwProps plugin there? 

Though I'm quite sure that on the codepen it will just work. As same es it does work on the other codepens I used as a cheatsheet. As same as it did work in my application :-(

 

I already reinstalled gsap and downloaded and copied the bonus file again.

Also checked if the import has worked.

And now I'm changing parameters and ask here xD to get just any surface for the problem.

Link to comment
Share on other sites

If snap and ThrowProps aren't working it almost sounds like that plugin isn't loaded. If you could drop it into a demo, that would be great. Here's a GS draggable starter demo that loads what you need. Please fork it and see if you can reproduce the problem with your code.

 

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

Happy tweening.

:)

 

  • Like 2
Link to comment
Share on other sites

 

Like Craig said, it will be much better if we can see a reduced test case as it isn't very common that things just stop working.

 

Although he already provided a starter pen for you, definitely check out and bookmark: https://greensock.com/try-plugins

 

It gives you a codepen where you can easily copy the URLs of all the CodePen-safe bonus plugins OR fork a bare-bones demo that loads them all.

 

Once we can see the undesired behavior happening will be much better equipped to provide solutions.

  • Like 2
Link to comment
Share on other sites

Hello, 

Thanks for the demo stub :) It helped me to find the Problem.

 

It appears that the Draggable plugin does not work properly with TweenLite.

Appearently I switched at a time to use TweenLite instead of TweenMax without noticing that something broke.

 

Now it works as I use TweenMax again, thanks! :D

Link to comment
Share on other sites

5 minutes ago, GordonFreeman said:

It appears that the Draggable plugin does not work properly with TweenLite.

 

If you're talking about the files it's because Draggable also needs the CSSPlugin, which isn't bundled with TweenLite.

  • Like 5
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.
×