MeherG Posted October 30, 2020 Share Posted October 30, 2020 Hello, I'm new to greensock, this is my first animation that I'm trying to achieve ... I'm trying to get my flying hearts to start from the same position (position absolute to the container) Any help would be appreciated ! Thank you See the Pen eYzMZWo by mgara (@mgara) on CodePen Link to comment Share on other sites More sharing options...
Solution ZachSaucier Posted October 30, 2020 Solution Share Posted October 30, 2020 Hey MeherG and welcome to the GreenSock forums. You have a couple of options here. The best is probably to use a single SVG element instead of creating a new one each click. Just create a new heart path each click (or, even better, reuse the ones that you've made already) and append it to the SVG instead of creating a whole new SVG element each time. The alternative is to absolutely position your SVGs over each other but then you have a bunch of elements for no reason. I also noticed that you're using the old object form for your eases. We recommend the condensed string form instead: 1 1 Link to comment Share on other sites More sharing options...
MeherG Posted October 30, 2020 Author Share Posted October 30, 2020 @ZachSaucier I think I did my homework ! and I'm pretty happy of the result ! thank you very much ! Link to comment Share on other sites More sharing options...
ZachSaucier Posted October 30, 2020 Share Posted October 30, 2020 Glad to hear it! FYI going forward we request that you use the "fork" button on CodePen when creating new versions of demos that you link to in the forums so that future readers of the thread get the full context of what they're reading. 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