Created
March 31, 2015 20:10
-
-
Save mohnish/ea2137b975b2a3db392c to your computer and use it in GitHub Desktop.
typewriter.js
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
| var text = "mohnish".split(''); | |
| var i = 0; | |
| var curr = text[i]; | |
| var input = document.querySelector('your-selector'); | |
| var id = setInterval(function() { | |
| input.value = curr; | |
| i++; | |
| curr += text[i]; | |
| if (i == text.length) window.clearInterval(id); | |
| }, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
looks something like this http://cl.ly/aT4l