Created
May 2, 2012 12:44
-
-
Save kachi/2576313 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $("#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