Jump to content

R.J. LaCount

  • Posts

  • Joined

  • Last visited

Everything posted by R.J. LaCount

  1. @Visual-Q Yep, simply adding the following: text.innerHTML = text.innerHTML.replace("-", "<span>-</span>"); Prior to running SplitText does the trick. Appreciate the advice!
  2. Good idea. The text is coming in dynamically from the CMS, but I suppose I could write a little JavaScript to wrap any instances of hyphens in span elements before running SplitText.
  3. I think you're seeing it break correctly after that change because the object isn't formatted correctly (should be { type: 'lines, words' } ) which is causing a JavaScript error preventing SplitText from running at all.
  4. Hello, I'm encountering what I believe is a very similar issue to this thread, but I can't seem to get the applicable part of the solution to work in my context. I have some large hero copy in a narrow container with a hyphenated word that SplitText is unable to break apart. From what I'm reading in the linked thread, this is happening because the one "word" cannot be split into multiple divs, so I need to swap in a non-breaking dash character in for the regular one, but I'm not having luck pulling that part out into my demo. Attached a couple of screenshots in case the hyphenated word is not rendering at the same spot on your end in the Codepen example.