Share Posted May 21, 2018 Hello GSAPers, I would use something like: $el.click(() => { new TimelineMax() .to(...) } Is correct or disruptive in performance Link to comment Share on other sites More sharing options...
Share Posted May 21, 2018 All it means is that a new timeline will be created every time you trigger the click event and it will not be held in memory. So, unless you're passing in new parameters every time, there's no particular reason to do so. You can create the timeline once and only replay it on click. Having said that, there's nothing really bad or wrong by creating a " throwaway" timeline like that. Performance-wise.... Unless you are triggering thousands upon thousand of clicks or looping and creating thousands upon thousands of calculations on that one click, there's no real perceivable difference in performance. 5 Link to comment Share on other sites More sharing options...
Author Share Posted May 21, 2018 Thanks Sir @Dipscom 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