I found the code on the internet to type a text by jquery alone, but I want to add a delay in it to just start typing when the page scrolls in the section I want, how to add this function?
js code
var div = document.getElementById('texto');
var texto = 'Porque Contratar a Two Way?';
function escrever(str, el) {
var char = str.split('').reverse();
var typer = setInterval(function() {
if (!char.length) return clearInterval(typer);
var next = char.pop();
el.innerHTML += next;
}, 200);
}
escrever(texto, div);
The div is this:
<div id="texto"></div>