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
- Put a TEXT-ELEMENT onto your page.
- Add the formated CODE to your PAGE.
- Click —> PREVIEW!
- HAVE FUN!