Juraj Posted November 20, 2019 Share Posted November 20, 2019 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 See the Pen dyyrYgV by jurajmolnar (@jurajmolnar) on CodePen Link to comment Share on other sites More sharing options...
mikel Posted November 20, 2019 Share Posted November 20, 2019 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 3 Link to comment Share on other sites More sharing options...
Juraj Posted November 20, 2019 Author Share Posted November 20, 2019 Thank you @mikel i will try it now. Link to comment Share on other sites More sharing options...
Juraj Posted November 20, 2019 Author Share Posted November 20, 2019 That works, thanks man! Link to comment Share on other sites More sharing options...
ZachSaucier Posted November 20, 2019 Share Posted November 20, 2019 Hey Juraj, thanks for being a Shockingly Green member! As mikel pointed out, SplitText isn't built to handle browser resizing so you need to handle it manually. Reverting it like what mikel did is a good option because it essentially removes the markup that SplitText adds after the animation. 2 Link to comment Share on other sites More sharing options...
Juraj Posted November 20, 2019 Author Share Posted November 20, 2019 Thank you both, I am a getting a bit smarter with greensock every day 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now