Line 104: | Line 104: | ||
var pauseMax = 80, | var pauseMax = 80, | ||
pauseMin = 40, | pauseMin = 40, | ||
− | + | cht = 0; | |
− | + | qsa("[data-typer]").forEach( | |
− | + | function(e,i){setTimeout(function typeItt() { | |
− | + | if (ch > e.dataset.typer.length)return; | |
− | + | if(e.dataset.typer[cht]!="<") | |
− | + | e.innerHTML = e.dataset.typer.substring(0, cht++); | |
− | + | else e.innerHTML=e.dataset.typer.substring(0, cht+=3); | |
− | + | ||
− | + | ||
− | setTimeout(function typeItt() { | + | |
− | + | ||
− | if (ch > | + | |
− | if( | + | |
− | + | ||
− | else | + | |
setTimeout(typeItt, ~~(Math.random() * (pauseMax - pauseMin + 1) + pauseMin)); | setTimeout(typeItt, ~~(Math.random() * (pauseMax - pauseMin + 1) + pauseMin)); | ||
− | }, | + | },e.dataset.delay);setTimeout(function(){e.removeAttribute("data-typer")},qs("[data-typer]").dataset.delay); |
</script> | </script> | ||
</div> | </div> |
Revision as of 19:37, 30 October 2017