Line 101: | Line 101: | ||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600" rel="stylesheet"> | <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600" rel="stylesheet"> | ||
<script> | <script> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
$("[data-typer]").attr("data-typer", function(i, txt) { | $("[data-typer]").attr("data-typer", function(i, txt) { | ||
Line 115: | Line 108: | ||
pauseMin = 40, | pauseMin = 40, | ||
ch = 0; | ch = 0; | ||
+ | function typeIt(typer) { | ||
+ | if (ch > tot) return; | ||
+ | if(txt[ch]!="<") | ||
+ | typer.html(txt.substring(0, ch++)); | ||
+ | else typer.html(txt.substring(0, ch+=3)); | ||
+ | setTimeout(typeIt(typer), ~~(Math.random() * (pauseMax - pauseMin + 1) + pauseMin)); | ||
+ | } | ||
setTimeout(typeIt($typer),$typer.data("delay")); | setTimeout(typeIt($typer),$typer.data("delay")); | ||
Revision as of 18:30, 30 October 2017