bdrtsky Posted June 25, 2020 Share Posted June 25, 2020 How do I detect when last staggered element is fired? I need to start another animation on this event. Link to comment Share on other sites More sharing options...
ZachSaucier Posted June 25, 2020 Share Posted June 25, 2020 Inside of the stagger object you can place callbacks like onStart that will fire once that element is fired. For example: gsap.to(".box", { x: 100, stagger: { each: 0.1, onStart: myFunc } }); See the stagger docs for more info. Link to comment Share on other sites More sharing options...
_Greg _ Posted June 25, 2020 Share Posted June 25, 2020 As i understand, if you need detect only last element (when animation finish), you can use onComplete See the Pen abdwjMW?editors=1111 by -greg- (@-greg-) on CodePen If you need detect for every element, place onComplete inside stagger: {} Link to comment Share on other sites More sharing options...
bdrtsky Posted June 25, 2020 Author Share Posted June 25, 2020 Thanks, it works 👍. But it is practically not noticeable in Docs Link to comment Share on other sites More sharing options...
_Greg _ Posted June 25, 2020 Share Posted June 25, 2020 29 minutes ago, bdrtsky said: But it is practically not noticeable in Docs About Callbacks About Callbacks inside stagger About Callbacks inside timeline 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now