AsKadir Posted May 2, 2021 Share Posted May 2, 2021 Hey all, I have a simple draggable horizontal div with images, I'm trying to get velocity of inertia onDrag, I can't understand what's the problem, I get an error tracker.get is not a function What am I doing wrong? Can you help me, please? Thanks in advance! See the Pen dypBQyR by ChicagoJostik (@ChicagoJostik) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted May 3, 2021 Solution Share Posted May 3, 2021 That's just because the track() method returns an Array of trackers (because you might pass selector text as the target, for example, so there could be a bunch of trackers - one for each element). In your case, it should be as simple as: // BAD let tracker = InertiaPlugin.track(holder, "x"); // GOOD let tracker = InertiaPlugin.track(holder, "x")[0]; 1 1 Link to comment Share on other sites More sharing options...
AsKadir Posted May 3, 2021 Author Share Posted May 3, 2021 @GreenSock Thanks, Jack! Link to comment Share on other sites More sharing options...
billyZduke Posted June 1, 2021 Share Posted June 1, 2021 Might want to add this info to the InertiaPlugin docs, as they currently contain only the "bad" example. Link to comment Share on other sites More sharing options...
GreenSock Posted June 1, 2021 Share Posted June 1, 2021 47 minutes ago, billyZduke said: Might want to add this info to the InertiaPlugin docs, as they currently contain only the "bad" example. @billyZduke would you mind providing more details about where you found those? I can't seem to find any but I must be missing something obvious. Link to comment Share on other sites More sharing options...
billyZduke Posted June 1, 2021 Share Posted June 1, 2021 GreenSock | Docs | Plugins | InertiaPlugin | static.getVelocity() 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now