This should not be a problem, but the solution depends on your input format. You need to select the text in the lines, which can be done as follows:
var lines = text.split("\n");
Then you can do something with each line however you want, for example:
var timer, displayLine = function(){ var nextLine = lines.shift(); if(nextLine){ var newLine = $('<span class="initState">' + nextLine + '</span>'); $('#someContainer').append(newLine); newLine.animate({ [PUT SOME ANIMATION HERE] }, 1000); } timer = setTimeout(displayLine,3000); } } timer = setTimeout(displayLine,3000);
See the full example here: http://jsfiddle.net/7dd52/
source share