Jump to content

Jake Wade

staggerFrom() not quite Completing

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

I am adding to a Timeline using a forEach loop but after one cycle the CSS props aren't quite finished for one element - the opacity is ~0.179 and not 0, the top is 46px and not 50px.


I assume it's to do with my timings as it's the first .element-span of the first .contact_distance_item, but I cannot think how to debug it to test (it took me a while to get this far, playing with delays etc).




See the Pen XPQmNG by hellojakewade (@hellojakewade) on CodePen

Link to comment
Share on other sites

You were calling staggerFrom on elements with class 'element-span'. So each loop was adding same elements to the timeline which was creating conflict. You need to select children of current element instead of all elements.


See the Pen JaVYVX?editors=0010 by Sahil89 (@Sahil89) on CodePen



  • Like 5
  • Thanks 1
Link to comment
Share on other sites

Ahhhh, silly mistake. ?‍♂️  I was so fixated on the GSAP timeline part!


Thank you for the quick fix! 

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