Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

TextPlugin animation get stuck after scrolling

Recommended Posts

Hi everyone !


I'm a beginner to GSAP and I wish I had know this masterpiece years ago (congrats to the team).

I'm testing out the various plugins and I'm currently having a weird behaviour while using both TextPlugin and ScrollTrigger.

My goal is to have a text that got typed when it's container heads up in the viewport (using ScrollTrigger) and keeps going until entire text is written.

My ScrollTrigger seems to be working fine, but at the second I'm scrolling the text out of the view port, the animation stops (and I don't want this).


Codepen instructions for testing :

1. Scroll to the text div, text starts to get animated.

2. Scroll down until text div goes out of viewport.

3. Scroll back to text div, it stucks a second or more and then updates the animation.


I suppose this is a misusage of the libs, but as a beginner any insight is highly valuable for me.


Thanks for your time !



See the Pen YzVGrqW by florian-trang (@florian-trang) on CodePen

Link to comment
Share on other sites

You don't have to use toggle. Try onEnter

  • Like 5
Link to comment
Share on other sites

Well that makes sense 😄  I used the basic example and didn't notice there was the onEnter event.

Thanks for the tip, it's working as expected now !


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