seniormelikyan,
Вариант
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
div{
font-size: 24px;
height: 30px;
}
</style>
<script src="https://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$.fn.typewriter = function (params) {
function writer(elem, text, speed, repeat) {
var i = 0,
TextNode = document.createTextNode("");
elem.appendChild(TextNode);
elem.timer = setInterval(function () {
if (text.length === i) repeat ? (i = 0, TextNode.data = "") : clearInterval(elem.timer);
else
for (TextNode.data += text[i++];" " === text[i];) TextNode.data += text[i++]
}, speed)
}
var options = {
speed: 500,
repeat: false
}, options = $.extend(options, params);
return this.each(function () {
var text = $(this).text();
$(this).text("");
writer(this, text, options.speed, options.repeat)
})
};
</script>
<script type="text/javascript">
$(window).load(function(){
$(".one").typewriter({repeat: true});
$(".too").typewriter();
});
</script>
<title></title>
</head>
<body>
<div class="one">Всем доброй ночи.</div>
<div class="too">Код написан на jQuery.</div>
</body>
</html>