call007 Posted June 23, 2022 Share Posted June 23, 2022 Hi everyone! I'm trying to animate x1 and y1 line attributes of an svg with gsap.quickTo by mousemove. But it doesn't work at all. Maybe I'm doing something wrong. Or maybe gsap.quickTo doesn't work correctly with these svg attributes. Anyway, please help me to understand how I can solve this problem. Thanks! See the Pen abqgPYy by call007 (@call007) on CodePen Link to comment Share on other sites More sharing options...
call007 Posted June 23, 2022 Author Share Posted June 23, 2022 Currently, I was able to make what I wanted. But one thing that frustrates me is the duration animation of the mouse ball doesn't match the duration animation of the lines. See the Pen oNErRLJ by call007 (@call007) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted June 23, 2022 Share Posted June 23, 2022 That's because you're creating a bunch of conflicting tweens that are fighting with each other for control on every mousemove event. Just set overwrite: true on your line tweens and that fixes it. 1 Link to comment Share on other sites More sharing options...
call007 Posted June 24, 2022 Author Share Posted June 24, 2022 It really works! Thank you, Jack! Just in case an article about it that I've found. But I have the last question 😃 Is it possible to animate SVG attributes with gsap.quickTo function? See the Pen YzemNPy by call007 (@call007) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted June 25, 2022 Solution Share Posted June 25, 2022 16 hours ago, call007 said: But I have the last question 😃 Is it possible to animate SVG attributes with gsap.quickTo function? No, because .quickTo() is highly optimized to pipe things directly into the low-level PropTweens, skipping initialization, plugin parsing, etc. However, if your goal is to minimize memory (avoid creating a new tween on every mousemove), you could reuse the same tween and just invalidate().restart() it: See the Pen KKQOGRm?editors=0010 by GreenSock (@GreenSock) on CodePen Does that help? 1 Link to comment Share on other sites More sharing options...
call007 Posted June 25, 2022 Author Share Posted June 25, 2022 That is what I needed. It's perfect! Thank you very much for your help! 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