In a recent web project, we came across the need to use an effect to replicate human interaction and emulate this on the website. The requirement was to type out text, optionally delete portions or all of the output and allow simple options to be used to determine the speed, delays amongst other possibilities.
As often is the case, there were a few options to use from exiting jQuery plugins, however none that I came across worked close enough to the requirement – without drastically modifying them to suit. Having previous experience creating plugins using the jQuery library, piecing something together to produce the desired effect was something to look forward to.
On a quiet Sunday afternoon, the first draft of the Teletype jQuery Plugin was complete within a few hours, and soon after released into the public domain. It’s been a while since a small personal project like this has been packaged up and shared with the community, which was one of the main reasons for proceeding with the idea.
- jquery.js – 2.1.1 was used during development of this plugin.
For full details on the plugin, including the customisation options that can be defined, please refer to the readme hosted on GitHub.
Customisable options can be passed through to the demo site to produce examples of the plugin options.
For example, setting the
`preserve` option to true visit http://teletype.rocks/?preserve=true.
This is true for many of the options described in the readme, allowing you to preview the potential of the plugin.
In this example, we preserve the output rather than deleting it, only loop through the text once, set the prefix to
"> " and the cursor as
If you intend to use this plugin or have already implemented it in your project, I’d be pleased to see some examples of it in use out in the wild.