Jump to content
Search Community

SplitText weird line breaks

Juraj test
Moderator Tag

Recommended Posts

Hey guys, I need a little help with splitText weird behaviour. Every single time i visit the staging site, splitText split lines wrongly. 
I have to refresh and then everything looks, ok. Same thing when i resize the browser the text is not wrapping automatically like it should. Do you have any ideas of what might be wrong? 

I use intersectionObserver to detect the item in viewport and then triggering the TweenMax function. 
Thank you very much

after-refresh.png

before-refresh.png

See the Pen dyyrYgV by jurajmolnar (@jurajmolnar) on CodePen

Link to comment
Share on other sites

Hey @Juraj,,

 

You could call your function with an onComplete

 

stAnim.staggerFrom(mySplitText.lines, 2, {
    opacity: 0,
    y: 30,
    transformOrigin: "0 0",
    rotation: 8,
    rotationX: 15,
    ease: Quart.easeOut,
    clearProps:"all",
    onComplete:allDone
  }, .175)  // .  }, .175, allDone);

  function allDone() {
    mySplitText.revert()
  }

 

Happy tweening ...

Mikel

 

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