Jump to content
GreenSock

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

SplitText -- extra blank lines

Go to solution Solved by GreenSock,

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

For a block of text with three lines, I'm using SplitText to split by line and I'm getting five lines out. The first and last of those are empty, and take up no space.

 

I only see this behaviour if the text has whitespace around it. Such as

<h2>
    Here is the header; it takes up three lines.
</h2>

It's annoying, since I have to filter the blank ones out before I can animate and do things like a delay depending on the line number. It could also lead to misleading line number counts.

 

Is this a known bug?

Link to comment
Share on other sites

  • Solution

I just sent you an email about this with an updated file to try. Please let me know if that works better for you. 

  • Like 1
Link to comment
Share on other sites

I didn't get it the email; please double-check you sent to the right address.

 

I also found just now that no-break spaces aren't preserved when splitting only by line. This is causing visual issues for me. Or are no-break spaces simply not supported? (Do you want this in a separate thread? I know I would if this were a bug tracker for something of mine...)

Link to comment
Share on other sites

Oh, it ended up in my (Google Mail) spam box, presumably due to the zip attachment. I'll review it shortly.

Link to comment
Share on other sites

Yes, much better; thanks. Will this make it into mainline?

  • Like 1
Link to comment
Share on other sites

Absolutely. 

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