Jump to content
GreenSock

Jessiu

scrollTrigger start new item on same line

Moderator Tag
Go to solution Solved by PointC,

Recommended Posts

I am getting the sentences to change color, but I want only one sentence changed at one time, but since they are on the same line the start and end is at the same point. I am a newbie to js and gsap. . Can anyone provide assistance?

See the Pen dydaWJz by jessicauresti-the-selector (@jessicauresti-the-selector) on CodePen

Link to comment
Share on other sites

Hi @Jessiu :)

 

Welcome to the forum.

 

Sounds like you're looking for the SplitTextPlugin.

 

That would allow you to split the text into lines and set up a ScrollTrigger for each one. The plugin is a perk for Club GreenSock members, but you can try it on CodePen for free.

 

See the Pen 462fb94d7a45cc5239461a133c8c6211 by PointC (@PointC) on CodePen

 

Hopefully that helps. Happy tweening and welcome aboard.

:)

 

  • Like 2
Link to comment
Share on other sites

That might help but I want the text broken up into sentences not each line. Not sure if that solves what I am looking for? The sentences are on the same line. Thank you.

Link to comment
Share on other sites

Isn't that what your original demo is doing? Each <li> is triggering a color change. I don't follow your desired outcome. If you want the <li> elements to be on individual lines, you'll need to change your CSS and get rid of the display:inline.

 

ul#hometext li {
/*   display:inline; */
  font-size:80px;
}

 

Link to comment
Share on other sites

  • Solution

Okay, now I follow. Yeah - SplitText won't be the answer here.

 

I'd just set it up as one timeline, use the parent container as a trigger and set scrub to true.

 

See the Pen d0c1bbfdfaf738f29d61540e2eef6e19 by PointC (@PointC) on CodePen

 

Happy tweening.

  • Like 2
Link to comment
Share on other sites

wowza that looks good I will be working on that asap!

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