Jump to content
Search Community

splittext + scrolltrigger glitch

gweatherson test
Moderator Tag

Recommended Posts

34 minutes ago, gweatherson said:

Only issue is it seems to fire twice and I'm not sure why.. thanks!

Can you elaborate a bit? What fires twice? 

 

Be very careful about using from() tweens in that manner because you're likely to run into logic issues. Remember that .from() tweens will use the CURRENT value as the end, and start at whatever you define. So think about what would happen if the user scrolls down quickly and then back up and down again very fast - those elements would be in the middle of tweening (let's say they're at opacity of 0.2) and then the .from() fires. That means it'll use 0.2 as the destination value, thus things will end up looking like they're stuck mid-tween but it's not a bug in GSAP at all - it's just a logic issue in your code. See what I mean? 

 

See this article: 

 

 

Here's how I'd do it (if I understand your goal correctly): 

See the Pen YzrdjVJ?editors=1010 by GreenSock (@GreenSock) on CodePen

 

Does that help? 

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