Jump to content
Search Community

Issue with <br> and Text Plugin

Lorenzo Migliorero test
Moderator Tag

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

Hi guys, i have a little problem with the awesome text plugin...

It is possible to exclude <br> from the tween parser, and put in the the string as complete tag in a single step?
 
For example:
 
abc<br>abc became
a - b - c - <br> - a - b - c
 
and not
a - b - c - < - b - r - > - a - b - c
 
Thanks for the answers,
Lorenzo
Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

Sorry, our TextPlugin is currently designed only to handle animating plain text chars. 

Unfortunately, its not something we can accommodate quickly.

It's certainly a valid feature request and perhaps something we'll be able add in the future.

 

 

Thanks for asking.

  • Like 1
Link to comment
Share on other sites

  • 3 years later...

Replace br with some tag and then replace again that with br and then give span some css

      

$demoText.html( $demoText.html().replace('<br>', "^").replace(/./g, "<span>$&</span>").replace(/\s/g, " ").replace('^', "<br>"));
jQuery('br').parent('span').addClass('test');

          

span.test {
    display: block !important;
    height: 0;
}

 

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