Created
April 6, 2018 08:46
-
-
Save fxrobin/aebdfbe16e319504c0c14923aa491c58 to your computer and use it in GitHub Desktop.
Displays a String like Terminator
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 = $('.typewriter').text(); | |
| var length = text.length; | |
| var timeOut; | |
| var character = 0; | |
| (function typeWriter() { | |
| timeOut = setTimeout(function() { | |
| character++; | |
| var type = text.substring(0, character); | |
| type = type + "\u2588"; | |
| $('.typewriter').text(type); | |
| typeWriter(); | |
| if (character == length) { | |
| clearTimeout(timeOut); | |
| } | |
| }, 30); | |
| }()); | |
| ---- USE : | |
| <p class="typewriter">Nullam id dolor id nibh ultricies vehicula ut id elit. | |
| Maecenas faucibus mollis interdum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi leo risus, | |
| porta ac consectetur ac, vestibulum at eros. Cras justo odio, dapibus ac facilisis in, egestas</p> | |
| ---- NEED : JQUERY 1.10.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment