SecretBabka,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<div></div>
<script>
function typeText(d, g, h, e) {
var a, b, f = performance.now();
requestAnimationFrame(function k(c) {
if (!b || !b.length)
if (b = g.shift()) a = document.createElement("br"), d.appendChild(a), a = document.createTextNode(""), d.appendChild(a), b = b.split("");
else {
e && e();
return
}
c = (c - f) / h;
1 < c && (c = 1);
1 == c && (f = performance.now(), a.data += b.shift());
requestAnimationFrame(k)
})
};
var div = document.getElementsByTagName("div")[0];
typeText(div, ["ololo ololo lololo lolo","всяка фигня","Вы прочитали это важное сообщение"], 100, function() {
alert("УРА!!!");
});
</script>
</body>
</html>