#typeWriter.js
typeWriter.js is easy and free to use lightweight library written and based on javascript. It get the content of element on a webpage and re-display it by typing it on the page
- Download the zip file here and extract it to get the minified version and unminified version.
- Include either the minified version or the unminifed version onto your webpage(minified version required for performance).
- Write this code into your custom javascript file
typeWriter("selector","true",interval)
NB: Since your custom javascript file will be a dependecy on the typeWriter.js file, when including the files onto the page typeWriter.js file must come first before your custom javascript file.
The first argument which is the selector
takes in the id of the element you want it content to be re-display on the page
Example: If you have a paragraph element on the page <p id="para">Hello world<p>
. You reference it with the id name this way typeWriter("#para","true",interval)
The second argument "true"
is required for the code to work.
The third argument is optional,It specifies how fast the typing should go. So writting the code this way will still work typeWriter("#para","true")
the default is set to 100. You can choose any value from 10-100 which is preferable, this code typeWriter("#para","true",20)
will run the content faster. The less the value the faster the typing runs
#DEMO - View Demo