Skip to content

Instantly share code, notes, and snippets.

@kachi
Created May 2, 2012 12:44
Show Gist options
  • Select an option

  • Save kachi/2576313 to your computer and use it in GitHub Desktop.

Select an option

Save kachi/2576313 to your computer and use it in GitHub Desktop.
$("#type").each(function() {
var $this = $(this);
var str = $this.text();
$this.empty().show();
str = str.split("");
str.push("|");
// increase the delay to ghostType slower
var delay = 100;
$.each(str, function(i, val) {
if (val == "^") {
// Do nothing. This will add to the delay.
}
else {
$this.append('<span>' + val + '</span>');
$this.children("span").hide().fadeIn(100).delay(delay * i);
}
});
$this.children("span:last").css("textDecoration", "blink");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment