Jump to content
Search Community

TimelineMax onAdd/onChange/onRemove event?

mapps-video 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

3 minutes ago, ZachSaucier said:

Hello mapps-video.

 

You can check out all of the properties, methods, and callbacks of TimelineMax in the docs for TimelineMax. Let us know if you have any particular questions about their usage or need help with your particular use case (in which case a CodePen of your issue would greatly aid us in helping you).


I appreciate the answer, but it doesn't help me.
I looked already at the docs, still I have this question:

 

Are there any events fired when adding/clearing/removing (a tween, timeline, callback, or label) to/from the timeline?

Link to comment
Share on other sites

3 minutes ago, PointC said:

There are no callbacks for those events you listed, but you'll have to be firing some sort of function to make those things happen so you can put the necessary logic or action in those functions.

 

Good to know. I am doing that currently, just, there are different sources which manipulate the timeline. 

 

It would help me a lot to have such events, so I don't care what is the "source of change". 


I think this could be a new feature request?
 

Link to comment
Share on other sites

You can certainly request it. That would be up to @GreenSock to make that decision. I know he likes to keep the codebase lean and mean so things that are called from other event handlers aren't always included. That's the reason there isn't an onReverseStart() callback.

 

But Jack will probably drop by with his thoughts.

 

Happy tweening.

 

Link to comment
Share on other sites

1 hour ago, PointC said:

I know he likes to keep the codebase lean and mean so things that are called from other event handlers aren't always included. That's the reason there isn't an onReverseStart() callback.

 

Yep, exactly right. 

 

1 hour ago, PointC said:

There are no callbacks for those events you listed, but you'll have to be firing some sort of function to make those things happen so you can put the necessary logic or action in those functions.

 

Right again :)

 

Indeed, we place a huge priority on performance since animation is the most performance-sensitive part of UX. In all my years of doing this, I think this may be the 2nd or maybe 3rd time someone has wanted this kind of functionality, so it'd feel weird to make everyone else pay the performance (and file size) penalty for adding that functionality, especially because it's pretty simple to add it externally. 

 

For example, you could just implement an add() and remove() (or to()/from()/whatever) function in your own code that has the event dispatchers built-in. Think of them like wrappers around GSAP's functionality. See what I mean? It's just one more layer of abstraction.

  • Like 2
  • Thanks 1
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...