You can scroll through each char of your line and use typped () at random speed for each letter and add the result to the html element
var myString = "The text to be animated goes here";
var max = 2500;
var min = 100;
for (i = 0; i < myString.length; i++) {
$("#typed").append().typed({
strings: [myString[i]],
typeSpeed: Math.floor(Math.random() * (max - min)) + min,
backDelay: 500,
loop: false,
loopCount: false,
});
}
Working solution with setTimout () instead of typed ()
var myString = "The text to be animated goes here";
var max = 200;
var min = 0;
function doSetTimeout(character, delay) {
setTimeout(function() {
$("#typed").append(character);
}, delay);
}
for (var i = 0; i < myString.length; i++) {
var delay = Math.floor(Math.random() * (max - min)) + min + (i * max);
doSetTimeout(myString[i], delay);
}
source
share