I’m trying to build an interaction where I’d like to move around every single letter within a one word heading. Therefore, I tried to span every letter of the heading into seperate text spans.
The problem is, every time I add a span to the letter next to one that is already spanned, it is added to the existing span. Is there any way to prevent that from happening? Or is there a better way to solve it?
Another way of keeping different spans is to simply add a class to each after creating it. This way the next letter with the span will not be autoadded to the previous one.
You might want to consider GSAP, it has a plugin called SplitText which makes stuff like what is described trivial. The GSAP animation engine is far superior to IX2. See → SplitText | GSAP | Docs & Learning