VP Dev1 Posted March 29, 2022 Share Posted March 29, 2022 Refer to this demo Here are the screenshot after loaded the demo. Clicked on [lines] You can find the orange text "nested tags" does not being split correctly. How can I solve? Thank you. See the Pen pEKYVz by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
OSUblake Posted March 29, 2022 Share Posted March 29, 2022 Welcome to the forums @VP Dev1 If you check out Notes & limitations section in the SplitText docs, you'll see that it doesn't support splitting nested elements by lines. You can try this workaround. 1 Link to comment Share on other sites More sharing options...
GreenSock Posted March 30, 2022 Share Posted March 30, 2022 Yep, Blake is right. To clarify... What you’re asking would actually have to chop individual elements up and that could have very negative effects. For example, let’s say you have this: <div>one two <span id="nested">three four</span></div> Let’s say the word “four” wraps onto a 2nd line, so now you’ve got “three” and “four” which are both inside a <span> with an id on it, and that likely has some CSS rules applied, etc. How would we split that? See the problem? That one <span> now becomes two (one in each line wrapper <div>)? And do they both have an id of “nested”? That’s invalid markup and it could break your CSS. I’d suggest reworking your setup to better accommodate what you’re trying to do with the splitting. From what I can tell, it’s simply impossible to accommodate your request. Thanks for the helpful screenshots! Happy tweening. 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