Here is the fancier version that makes the jQuery plugin to add text to any object, and it disappears in each subsequent letter. You can see how it works here: http://jsfiddle.net/jfriend00/yMJsc/ .
You call it this way:
$(".myClass").revealText("The quick brown fox jumped over the fence.", 500);
And here is the code for implementing the jQuery plugin.
$.fn.revealText = function(text, duration) { duration = duration || 250; for (var i = 0; i < this.length; i++) { showNextChar(this[i], 0); } function showNextChar(item, len) { var base = text.substr(0, len); var nextChar = text[len];
source share