Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typeit

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeit

A versatile, easy-to-implement jQuery animated typing plugin that types text for you.

  • 4.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.5K
increased by1.99%
Maintainers
1
Weekly downloads
 
Created
Source

TypeIt: The Most Versatile jQuery Animated Typing Plugin on the Planet


Table of Contents

  • Overview
  • Choose a License
  • Setup
  • Simple Usage
  • Advanced Usage (Chaining Companion Functions)
  • Options
  • Contributions
  • Documentation (offsite)

Overview

TypeIt is the most versatile, user-friendly jQuery animated typing plugin on the planet. In simple use, it allows you to type single or multiple strings that break lines, delete & replace each other, and it even handles HTML tags & entities.

For more advanced, controlled typing effects, TypeIt comes with companion functions that can be chained to tweak your typing down to the smallest character, enabling you to type not just a few strings of text, but an entire narrative, with complete control over speed, characters, line breaks, deletions, pauses, everything.

Some of the Perks

  • Choose to start typing only when your element becomes visible on the screen.
  • Loop your string(s) continuously.
  • Define you strings via JSON or in the HTML (useful in case user doesn't have JavaScript enabled).
  • Create several unique instances on a single page.
  • Handle HTML tags (including those with classes, ID's, etc.) and entities with ease.
  • Use companion functions to chain individual commands together to fine tune your typing.
  • Supported by jQuery 1.8.0 or higher.
  • Lightweight. (~5kb, single JavaScript file)

Demos

Checkout several demos and a sandbox where you can try it out at macarthur.me/typeit.

Documentation

View the full documentation for using TypeIt here: macarthur.me/typeit/docs.

Choose a License

To get started, first select a license:

Setup

Get the Code

Get it from this repo, or from the following sources:

  • CDN: Include https://cdn.jsdelivr.net/jquery.typeit/4.0.0/typeit.min.js on your page.
  • npm: Install with npm install typeit.

Hook It Up

  1. Load jQuery and typeit.js on your page.
<script src="jquery-2.1.4.min.js"></script>
<script src="typeit.js"></script>
  1. Create an empty HTML element to select. (If you want to have a fallback for users without JavaScript, you can put a string or strings right into this element. More on that later.)
<span class="type-it"></span>

You're ready to start typing!

Simple Usage

In it's simplest use, just call typeIt() on any element and include your options.

Example:

  $('.type-it').typeIt({
    strings: ['Enter your string here!', 'Another string!']
  });

Advanced Usage

To control your typing down to the smallest character, there are five companion functions available to use. Simply chain them together following a typeIt() call on an element, and your chain will execute. You can define your global settings within the function call like usual, and can even change settings on the fly throughout the chain.

For example:

  $('.type-it').typeIt({
    speed: 900,
    lifeLike: false,
    autoStart: false
  })
  .tiType('I am typing slowly,')
  .tiSettings({speed: 100})
  .tiType('but now I am typing pretty fasst')
  .tiDelete(2)
  .tiType('t!');

Companion Functions

FunctionArgumentsDescription
tiType()(string) Characters (including those wrapped in HTML) to be typed.Will type the characters.
tiDelete()(number) Number of characters to be deleted from what's already been typed.Will delete the number of
tiPause()(number) Number of milliseconds to pause before continuing.Will pause the specified number of milliseconds.
tiPause()(number) Number of milliseconds to pause before continuing.Will pause the specified number of milliseconds.
tiBreak()(none)Will break the typing to a new line.

Options

You can modify the options for the plugin by passging in JSON.

There are a number of options you may use to customize typeIt.

OptionDescriptionDefault Value
stringsThe string(s) to be typed.'Your default string.'
speedThe typing speed.100
lifeLikeWill make the typing pace irregular, as if a real person is doing it.true
cursorShow a blinking cursor at the end of the string(s).true
cursorSpeedThe blinking speed of the cursor.1000
breakLinesChoose whether you want multiple strings to be printed on top of each other (breakLines = true), or if you want each string to be deleted and replaced by the next one (breakLines = false).true
breakDelayThe amount of time between typing multiple strings.750
startDelayThe amount of time before the plugin begins typing after initalizing.250
loopHave your string or strings continuously loop after completing.false
loopDelayThe amount of time between looping over a string or set of strings again.750
htmlHandle strings as HTML, which will process tags and HTML entities. If 'false,' strings will be typed literally.true

Contributions

This project is setup with Gulp to lint & minify the JavaScript. In the root of the repo, use these commands to run these default tasks and watch for file changes (make sure Node.js, npm, and Gulp are installed on your computer):

npm install
gulp develop

Donations

If I've made your life eaiser in some way by creating this thing and want to kick a small "thank you" my way, I'd very much appreciate it!

PayPal: paypal.me/alexmacarthur

Venmo: venmo.com/amacarthur

Keywords

FAQs

Package last updated on 24 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc