Jump to content
Search Community

Revert the split text after each animation

Kopp001 test
Moderator Tag

Recommended Posts

Hi,

 

I've setup a little scrolltrigger that reveals words of each paragraph. What I would like to do is revert to a normal p tag once an animation has been executed.

 

So not once all of the animations have run but as things progress to revert them one by one? 

 

Is this possible with GSAP?

 

Thank you in advance for your help!

 

Kopp

See the Pen JjvgJQg by kkopp001 (@kkopp001) on CodePen

Link to comment
Share on other sites

Hi,

 

The issue is that you are creating one SplitText instance for all the paragraphs in your setup. If you want to revert every paragraph one by one, is better to create a SplitText instance per paragraph and revert it using the onLeave callback attached to the specific ScrollTrigger instance:

See the Pen poVMdPr by GreenSock (@GreenSock) on CodePen

 

Hopefully this helps. Let us know if you have more questions.

 

Happy Tweening!

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