Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
erikb

can splittext tokenize blankspace too?

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I have some underlined text I am splittexting and then staggering.  The blankspaces with underlines are just sitting still.  Can I tokenize them too?

Link to comment
Share on other sites

Hello and welcome to the GreenSock Forums.

 

So we can better help you, can you please make a limited codepen or jsfiddle with your issue so we can see what your HTML, JS, and CSS look like in context.

 

See the Pen by pen (@pen) on CodePen

http://jsfiddle.net/

 

Or if you have a link to your site or web page example.

 

It will help alot in helping you!

 

Thx :)

Link to comment
Share on other sites

Hi Erik,

 

The thing is that spaces are transformed to text nodes between the div elements created by the SplitText tool, therefore they aren't DOM elements so they can't be animated.

 

The possible solutions are to underline just words using wordsClass or create a code to wrap each text node inside a <div> tag so they can be animated as well. If you use words as the split criteria you can see that the text nodes are the odd ones, while the divs are the evens, so you can use JQuery selectors to do that.

 

Rodrigo.

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