A simple JavaScript typewriter effect on text
A simple JavaScript plugin that adds typewriter effect(with blinking caret) to text provided as attributes to an element.
Works on any JavaScript supported browser
Download the JS file and link to your html page.
<script src="directory/typewrite.js"></script>
In your html file, add text to the element you want to put the text as JSON format via data-set attribute. make sure you have set the data-period attribute as well and the class as typewrite
<h2 class="typewrite" data-period='100' data-set='["Some text here.", "Another text here."]', data-loop = 'false' data-delay='3000'>
</h2>
NOTE: data-delay and data-loop are optional. data-delay takes string of milliseconds of time you want the text to change to another if you have more than one block of text. data-loop takes either 'true' or 'false, it specifies if the text should keep changing indefinitely or not. data-period specifies the time it will take each text to be typed. Meanwhile data-set takes the texts to be typed.