Kopp001 Posted October 21, 2022 Share Posted October 21, 2022 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 More sharing options...
Rodrigo Posted October 21, 2022 Share Posted October 21, 2022 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! 1 Link to comment Share on other sites More sharing options...
Kopp001 Posted October 22, 2022 Author Share Posted October 22, 2022 Oh yeah, that could work, wouldn’t there be performance issues if I have around 20 paragraphs on my page or does this have no repercussions on performance? thank you so much for your quick answer ! Kopp 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