Jump to content
Search Community

ScrollTrigger with Repeated SplitText Loop

pietM test
Moderator Tag

Recommended Posts

Thanks for the quick response, Zach! 

 

I'm starting with a simple animation to understand the logic before elaborating a bit. The first caption DOES the correct behavior, but captions 2 and 3 do not. If you scroll to the second and third images, the captions don't trigger like the first. 


Thanks for your help! 
Very best, 
Michael 

Link to comment
Share on other sites

Some notes:

  • I would put the splitting within the forEach function for the captions. That way you have a reference to each individual split instead of only the collective. 
  • In GSAP 3 we recommend using gsap.timeline(). The Lite/Max stuff is old from GSAP 2.
  • Your stagger wasn't doing anything because you were selecting an individual letter. To make use of staggering, you should select all of the letters as the target. To learn more about staggers, check out the documentation.
  • Generally speaking it's good to wrap related elements into a container element. In this case I think a <section> would be appropriate. You could even just iterate through each section instead of having multiple forEaches if you wanted to.
  • I think my article on animating efficiently would be beneficial to you.

See the Pen WNrbmQq?editors=0010 by GreenSock (@GreenSock) on CodePen

 

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