Jump to content
Search Community

Do not assign TimelineMax() to variable. Is correct?

Victor Work test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

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.

  • Like 5
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...