Jump to content
Search Community

GSAP SplitText for lines instead of chars

pixelarchitect test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

I am using the SplitText with Scrolltrigger to make text appear on scroll, this works well for chars and words but as soon as I want to do it per line it doesn't work well anymore. The animation still triggers but it doesn't appear from behind the white anymore (except for the last sentence). Maybe this is just a CSS solution but im not sure... Does somebody know the thing im missing?

If you change 'quote.split.lines' to 'quote.split.chars' or 'quote.split.words' you can see what I mean because those work as intended (appearing from behind white)
 

[CODEPEN WAS DELETED]

Link to comment
Share on other sites

  • Solution

Hi,

 

You just need to create an extra SplitText instance that wraps the lines around other container in order to apply the overflow hidden property. Right now the lines you're creating with SplitText don't have a parent element that hides them, only their main container so that doesn't get you the effect you're after.

 

This seems to work the way you expect:

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

 

Hopefully this helps.

Happy Tweening!

  • Like 2
  • Thanks 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...