Jump to content
Search Community

how to do oncompleteAll for staggers

Lefthandmedia test
Moderator Tag

Recommended Posts

Hi,

I'm migrating some tweens from gsap2 to gsap3. i have a tween in my old code

    TweenMax.staggerTo(this.find('.level-1'), .5, {
      autoAlpha: 0, display: 'none', ease: Back.easeIn
    }, -0.03, allComplete, this);

allComplete is a function. How would i do the oncomplete all in GSAP3?

tnx

RDG

 

Link to comment
Share on other sites

@Carl the onComplete fires after each tweened object. I only want when ALL of them are complete

@ZachSaucier there is no mention of onCompleteAll in the docs. and that is what i ended up using after a lot of trial and error

the solution was

 gsap.to(this.find('.level-1'), {
      duration: .5,
      autoAlpha: 0,
      display: 'none',
      ease: "back.easeIn",
      stagger: {
        each: -0.03,
        onCompleteAll: allComplete,
        onCompleteParams: this
      }
    })

i had the most trouble finding onCompleteParams. Probably worth mentioning in the docs

Link to comment
Share on other sites

Hi

 

there must be a misunderstanding here. 
I updated my demo so that it is incredibly clear that the onComplete ONLY fires once after all the staggers finish. You will see the images fade after all Freds move down.  Also the console.log only fires once. Please take another look. 
 

 

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