Jump to content
Search Community

Recommended Posts

DapperDirewolf
Posted

Greetings!

 

My apologies in advance if the answer to this question exists somewhere. I have had a look but I've not been able to spot anything conclusive.

I've used TweenMax exclusively for years in my HTML5 banners, and sometimes my banners have quite a lot of animation going on throughout.

 

However there are typically time limits for animation (after which no animation can be going on), so when it comes to stopping every animation, I used to rely on the extremely useful TweenMax.killAll(); to end everything at the same time; particularly useful when there are dozens of animations (on smaller things) running at the same time.

 

Though GSAP 3 was released a while back, I've only just begun to adopt it into my banner development process. However, it seems (unless I am mistaken - and please do correct me if I'm wrong) that killAll() no longer exists as a function.

 

I'm sure there's a very good reason for this, and I know I can still kill the animations of everything individually, but it seems like unnecessary extra custom code I now need to write when there was previously a function to do this automatically for every single active tween, in one single stroke.

 

Am I missing something? Is there a plugin or something else I have been embarrassingly oblivious to?

 

Many thanks!

DapperDirewolf
Posted

Perfect and immediate solution to my problem. I feel an absolute fool for not realising these options existed!

 

Thanks heaps!

Posted
5 minutes ago, DapperDirewolf said:

I feel an absolute fool for not realising these options existed!

Don't, I learn things about GSAP fairly regularly, haha :) 

  • Like 1
  • Haha 1
Posted

Sure, how about this?

gsap.globalTimeline.clear()

That way, you're not pausing the entire timeline from that point on (which would mean future animations wouldn't play). Clearing a timeline just dumps all of its child animations. ?

 

I just added a note in the Migration Guide about this: 

 

  • Like 6

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...