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
- MathNotermans-93 years agoCommunity Member
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 linebreakconst 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.
Related Content
- 9 months ago
- 11 months ago
- 8 months ago