Hi, can anyone make this code work for 3 different texts (like build, create, show) with looping. Currently it's doing for one word/sentence only.
let i =0, interval =100, pause =5000;const text ="My text is here. Yes, it's here.";construnTyping=(ms)=>setTimeout(()=>showText(), ms);functionshowText(){$w("#text1").text = text.slice(0, i); i =(i +1)%(text.length +1); i >0?runTyping(interval):runTyping(pause);}$w.onReady(()=>runTyping(interval));
Seems like a code from J.D.
let i = 0; let interval = 100; let pause = 5000; const text = "My text is here. Yes, it's here."; let runTyping = ms => setTimeout(() => showText(), ms); console.log(runTyping()); function showText() { //let text = "xxx"; //text = text.slice(0, i); $w("#text1").text = text.slice(0, i); i = (i + 1) % (text.length + 1); i > 0 ? runTyping(interval) : runTyping(pause); } $w.onReady(() =>{runTyping(interval)});
J.D. your code-signature ? 😁
@thestrokestudio
1) Put a TEXT-ELEMENT onto your page.
2) Add the formated CODE to your PAGE.
3) Click ---> PREVIEW!
4) HAVE FUN!
Please format the code so it will be easy to read, and put it in code block.