Created
April 23, 2019 15:14
-
-
Save Farmatique/278c54a63441da346d3777eb1531cb58 to your computer and use it in GitHub Desktop.
Animation for printed text js, type animation
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
function printed_el_text( el ){ | |
var text = el.innerHTML, | |
i = 0, | |
__print = function (){ | |
i++; | |
if( i <= text.length ){ | |
el.innerHTML = text.substr(0, i); | |
setTimeout( __print, 20 ); | |
} | |
}; | |
__print(); | |
}; | |
printed_el_text( document.getElementById("type_text") ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment