textwriteout.js

A jquery plugin for writing out text and deleting text

A simple jquery plugin that will take text and write out a word letter by letter and then delete the text.

Download

Demo 1- Default Writeout

By default, the plugin will take the text inputted into the message value and write it out letter by letter into the target elemet. After each word, the element will be cleared of all text.

Output:

Javascript Code:

            $('#text-writeout-1').textWriteout({
              messages: ["Hello ", "World! "],
            });
          

Demo 2- Modify The Delete Process

The plugin can also be set to clear it's element after each word or not clear the element at all by changing the deleteWord and DeleteWords properties.

Output:

Javascript Code:

            $('#text-writeout-2-1').textWriteout({
              messages: ["5", "4", "3", "2", "1", "0"],
              deleteWord: true,
              deleteWords: true,
            });
          

Output:

Javascript Code:

            $('#text-writeout-2-2').textWriteout({
              messages: ["5", "4", "3", "2", "1", "0"],
              deleteWord: false,
              deleteWords: false,
            });
          

Demo 3- Preventing Looping Animation

There is also the option to stop the loop by modifying the loop property.

Output:

Javascript Code:

            $('#text-writeout-3').textWriteout({
              messages: ["ready, ", "get set, ", "go!"],
              deleteWord: true,
              deleteWords: false,
              deleteLastWord: false,
              loop: false,
            });
          

Demo 4- Affect The Speed

In addition, the speed of each process can be adjusted with the letterWait, wordWait and deleteWait.

Output:

Javascript Code:

            $('#text-writeout-4-1').textWriteout({
              messages: ["A ", "need ", "for ", "speed!"],
              letterWait: 50,
            });
          

Output:

Javascript Code:

            $('#text-writeout-4-2').textWriteout({
              messages: ["A ", "need ", "for ", "speed!"],
              wordWait: 200,
            });
          

Output:

Javascript Code:

            $('#text-writeout-4-3').textWriteout({
              messages: ["A ", "need ", "for ", "speed!"],
              deleteWait: 200,
            });
          

Demo 5- Additional Effects

There is also bonus effects that can be added to the text writeout to create different effects like creating a text cursor or selecting text before it is deleted.

Output:

Javascript Code:

            $('#text-writeout-5-1').textWriteout({
              messages: ["First Title", "Second Title", "Third Title"],
              deleteWord: true,
              deleteWords: false,
              deleteLastWord: false,
              loop: false,
              wordCursor: true,
              cursorBlink: true,
            });
          

CSS Code:

            #demo .word-cursor{
              color: #8758bc;
            }
          

Output:

Javascript Code:

            $('#text-writeout-5-2').textWriteout({
              messages: ["First Title", "Second Title", "Third Title"],
              deleteWord: true,
              deleteWords: false,
              deleteLastWord: false,
              loop: false,
              selectWord: true,
            });
          

CSS Code:

            #demo .word-selected{
              background-color: #8758bc;
              padding: 2px;
              color: #fff;
            }
          

Documentation

cursorBlink

Usage:

Will apply a blinking effect to the text cursor when set to true.

Default:

false

Type:

boolean

cursorBlinkWait

Usage:

Sets the time that the blinking effect on the text cursor will take to complete one animation loop (in ms).

Default:

1000

Type:

int

cursorBlinkWrite

Usage:

When set to true, if words are being printed into the element, the blinking effect of the text cursor will be dactivated.

Default:

true

Type:

boolean

cursorClasses

Usage:

Allows you to add extra classes to the text cursor.

Default:

' '

Type:

string

cursorTag

Usage:

Allows you to change the tag that the text cursor is wrapped within.

Default:

'span'

Type:

string

deleteLastWord

Usage:

If set to true, will delete the last word when not deleting all words.

Default:

true

Type:

boolean

deleteWait

Usage:

Sets the time that is waited before text is deleted(in ms).

Default:

1000

Type:

int

deleteWord

Usage:

If set to true, will delete each word after it is printed in the element.

Default:

false

Type:

boolean

deleteWords

Usage:

If set to true, will delete all the words after each one has been printed in the element.

Default:

true

Type:

boolean

introWait

Usage:

Sets the time that is waited before the loop begins.

Default:

0

Type:

int

letterWait

Usage:

Sets the time that is waited before each letter is printed into tle loop.

Default:

250

Type:

int

loop

Usage:

Will loop the process if set to true.

Default:

true

Type:

boolean

messages

Usage:

Allows you to change the text that is printed into the element.

Default:

'["Hello ", "World! "]'

Type:

string or object

outroWait

Usage:

Sets the time that is waited after the loop ends.

Default:

0

Type:

int

selectCursor

Usage:

If set to false, will hide the cursor when the selection effect is active.

Default:

true

Type:

boolean

selectCursor

Usage:

Sets the time that is waited before the select effect.

Default:

1000

Type:

int

selectWord

Usage:

If set to true, a select effect will cover the element before it deleted.

Default:

false

Type:

boolean

startWord

Usage:

Sets what word will be the starting point.

Default:

0

Type:

int

wordCursor

Usage:

If set to true, a text styled cursor will be placed after the target element.

Default:

false

Type:

boolean

wordWait

Usage:

Sets the time that is waited before wach word is printed into the element.

Default:

1000

Type:

int