Forum Discussion
Storyline360, Animation and GSAP ( Greensock )
I have your code working for the SplitText - just wondering if there is a way to add in a break in the text, it would be awesome to control where the hard returns are. See file for example
Did check whether in some way you could use <BR> in the text but that didnot work.
However you can detect a specific character and add a br-element in the code when creating the HTML-text.
Showing here...
https://360.articulate.com/review/content/068eab8b-a19e-4852-96a2-5dca03bf9886/review
@Jurgen as you can see 'fi' has issues :-)
So how to do this ?
Split the text into an array.//creating a textArray and splitting on %
const textArr = textStr1.split("%");
Then create a linebreak.//creating a linebreak
const br = document.createElement("br");
Finally loop through your array and add an arrayentry ( so a line ) and then add a linebreak.for(var j = 0; j < textArr.length;j++){
textNode = document.createTextNode(textArr[j]);
h1.appendChild(textNode);
h1.appendChild(br);
}
Working sample shared.