Jump to content
Search Community

Splittext - nested elements by line

Sascha Fincher test
Moderator Tag

Recommended Posts

Hi everyone,

 

I am trying to create a SplitText-Effect  where the lines of a text block are being revealed one by one. The problem is that I am using two different fonts in that text block and I am aware that splitting nested elements is normally not supported. The docs pointed me to a workaround, but it somehow still doesn't work.

I created a codepen that shows the problem.

 

Would really appreciate if anyone could look into this.

 

 

See the Pen LYymNmw by HankJamesMoody (@HankJamesMoody) on CodePen

Link to comment
Share on other sites

Hi @mikel

 

in my responsive layout, I need to have the lines wrap automatically, so a separate span is not really my preferred option.

 

Hi @OSUblake,

 

I want to use this effect for all my h1 and h2 headers. Using a div instead would really hurt my SEO, wouldn‘t it?

 

I understand that SplitText does not support this scenario, so I was wondering if I did not use the suggested workaround correctly.

 

Link to comment
Share on other sites

2 hours ago, Sascha Fincher said:

I want to use this effect for all my h1 and h2 headers. Using a div instead would really hurt my SEO, wouldn‘t it?

 

I'm not sure if it would affect it. You could have your h1 and h2 shown initially, and then hide or replace them. SEO is generally looking at the initial HTML, and not what happens after JavaScript runs.

 

Link to comment
Share on other sites

5 hours ago, OSUblake said:

 

I'm not sure if it would affect it. You could have your h1 and h2 shown initially, and then hide or replace them. SEO is generally looking at the initial HTML, and not what happens after JavaScript runs.

 

Ok, if that's the case SEO should not be a problem.

I changed the h1 into a div, but now the animation isn't working at all. I guess I need to rethink my layout/styling and try something different.

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