Jump to content
Search Community

Splittext -- need help animating spaces

gem test
Moderator Tag

Recommended Posts

I want to animate the background, but it is not continuous with the spaces between words. Is there a way that I can treat spaces as characters, so that they will be animated the same way. Thank you!!!

 

To be as clear as possible I want the background of the spaces to be treated exactly the same as the rest of the characters

See the Pen PoLjMva by bonfiremitch (@bonfiremitch) on CodePen

Link to comment
Share on other sites

No, SplitText doesn't create <div> wrappers for those spaces but all you're trying to do is animate each character like that, you probably don't even need SplitText - you could wrap each one in a <span> and animate like this: 

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

 

But honestly, you might consider creating a <div> behind each line and just animate the scaleX from 0 to 1 to get a cleaner effect. You could create a duplicate element behind your "real" element (with the same text), split by lines, make the text color transparent and animate the div's scaleX from 0 -> 1. 

 

Good luck!

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