Jump to content
Search Community

ScrollTrigger at different points on aligned elements

samp test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

Hi all,

 

See Codepen for what I have working. Looks good, I think!

 

What I'm actually trying to do is highlight the text character by character as the user scrolls down, rather than line-by-line. I thought I'd need to loop through and apply some kind of offset to each trigger, but I wasn't sure how to approach this. Has anyone ever achieved this with GSAP before and know how it's best done?

 

If it's not clear what I mean, here's a non-GSAP example on another site: https://bcorporation.uk/about-b-lab-uk/ (On "the B corporation movement's...")

See the Pen bGQaEyB by isambarding (@isambarding) on CodePen

Link to comment
Share on other sites

  • Solution

Hi @samp and welcome to the GreenSock Forums!

 

Maybe these examples can help:

 

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

 

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

 

The second example uses SplitText which is a benefit of Club GreenSock members. Is worth noticing that being a Shockingly Green Club member gives you access to all the bonus plugins and their updates for a year, which will let you do all sort of crazy things in all your projects, which normally pays itself with one project or two, then is all benefits.

 

Hopefully this helps.

Happy Tweening!

Link to comment
Share on other sites

Hi @Rodrigo!

 

That second example is just what I'm looking for, thank you! I forgot timeline was a thing :P

 

I do have access to SplitText (via my work account) - I'm using it in my demo :)

 

Thanks again!

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