Share Posted July 2, 2015 Hello, I'm trying to detect if my draggable "isThrowing"... https://greensock.com/docs/#/HTML5/GSAP/Utils/Draggable/isThrowing/ Clearly I'm doing it wrong? Thanks! See the Pen yNvEgY by MAW (@MAW) on CodePen Link to comment Share on other sites More sharing options...
Share Posted July 2, 2015 Hi Joe Hakooz pls be sure that using last version of GSAP ( 1.17.0 ) pls check this out : See the Pen yNvEgY by MAW (@MAW) on CodePen Link to comment Share on other sites More sharing options...
Author Share Posted July 2, 2015 Yep. Updated to latest version and it works. Thanks! Link to comment Share on other sites More sharing options...
Author Share Posted July 2, 2015 Spoke too soon. Looks like there's a possible bug. Using your codepen, throw the ball. Then click on the ball without dragging. Notice how it is returning true for each of the properties. Eventually it stops doing that, but I'm not sure how, when, or why. Is this a bug? The reason it matters is because I'm trying to allow a "mouseup" event ONLY when the draggable is not dragging or throwing. Thoughts? Link to comment Share on other sites More sharing options...
Share Posted July 2, 2015 i see... , but that's not a bug ! in fact with ' x,y ' we use subpixels not pixels and when you click without any drag that snap to nearest pixel , pls add something like this to your draggable creation to snap pixel perfect position on throwComplete : snap:{ x: function(endValue) { return endValue.toFixed(0) }, y: function(endValue) { return endValue.toFixed(0) } } See the Pen yNvEgY by MAW (@MAW) on CodePen 1 Link to comment Share on other sites More sharing options...
Author Share Posted July 2, 2015 Interesting. Works great in your demo but in my actual project, throwing now gives a funky rubber band feel. My actual implementation is more complex than a single ball. I'm using a bunch of "cards" that dynamically move around to create infinite scrolling. I'll need to play around a bit on my end and see what I get. Thanks for your help! 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