1
I found on the Internet this code to type a text alone by jquery, but I want to add a delay to it to just start typing when the page scrolls in the Section I want, how to add this function?
Code js
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>
That’s what I wanted, thank you very much!
– Clayton Furlanetto
Why when entering two codes changing only the ID does not work? I created another div as text2 and inserted the code again and put in the id text2 but it doesn’t work.
– Clayton Furlanetto
I’ll see to it for you....
– Sam
Basically you would have to create variables for each div, see: https://jsfiddle.net/foj26f8m/1/
– Sam
Perfect bro, vlw
– Clayton Furlanetto