exebetche Posted November 18, 2019 Share Posted November 18, 2019 Hi, I'm new with gsap and wanted to test the modifiers plugin, but demos on the plugin doc page are broken. In the first one with the rotating arrow does'nt move at all. The 2 others work, but the cdn link is to the previous tweenmax library and break as well if you update the script. I've played around with the pen, and it seems the "modifiers" callback is called, but the argument is a css string not a number, so I put a "parseFloat" but even with that the animation does not work... Any idea? Tx See the Pen ExxGZev by exebetche (@exebetche) on CodePen Link to comment Share on other sites More sharing options...
exebetche Posted November 18, 2019 Author Share Posted November 18, 2019 Ok I got it, the modifier callback should return the value with de css unit as well (+"deg" in this case). I've fixed the codepen. 1 Link to comment Share on other sites More sharing options...
GreenSock Posted November 18, 2019 Share Posted November 18, 2019 Yep, you got it. And just so you know, you could use the unitize() utility method to handle that stuff for you: See the Pen 9dce9b29a44766f58306bb9d2baba495?editors=0010 by GreenSock (@GreenSock) on CodePen Docs: https://greensock.com/docs/v3/GSAP/UtilityMethods/unitize() Happy tweening! 1 Link to comment Share on other sites More sharing options...
exebetche Posted November 18, 2019 Author Share Posted November 18, 2019 Good to know, thank you. Link to comment Share on other sites More sharing options...
ZachSaucier Posted November 18, 2019 Share Posted November 18, 2019 Keep in mind that in this particular use case it would probably be better to use the SnapPlugin in GSAP 3 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