Jump to content
Search Community

killAll and relaunch one

benoit 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

Hi,

 

I have few timelines for an open/close content with animation (transitions), I use killAll to deal with fast click between open and close, it's do the work.

Now I would like to add some simple tl with animation on mouse enter/leave… and killAll, kill them… how to unkill ? I don't know how I can deal with that.

See the Pen gdZmoO?editors=1111 by benoitwimart (@benoitwimart) on CodePen

Link to comment
Share on other sites

If you use killAll, it will kill all your other animations from entire page. Can't you just pause your timeline like you do on mouseleave? The reduced test case you posted doesn't show why you will want to kill your animations. I would suggest posting another simple demo that shows why you need to kill animations.

  • Like 5
Link to comment
Share on other sites

As Sahil said, if you killAll it will get rid of ALL of your tweens in the entire page. You cannot unkill it. It's not that it is a bad thing, it has its use cases, you just need to know when to use it.

 

It really sounds like the answer is to simply pause the animation on mouse enter and resume on mouse leave. You could overwrite tlEsad but why would you want to do that unless you plan to change its animation? If you are going to re-use the same animation, you are far better off by just pausing it.

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