SequenceRunner

© 2017 Leandro Silva (http://grafluxe.com)
License: MIT

SequenceRunner

Create unique loading text, HTML sequences, and even sprite animations.

Constructor

new SequenceRunner(settingsopt)

Creates a new SequenceRunner instance.
Parameters
settings:Object (optional)
The sequence settings.
settings.selector:String = ".sequence-runner" (optional)
The HTML container to write your content to. It can be an id, class, tag, etc.
settings.content:String|Array = "." (optional)
The content to add to your selected HTML container(s). If set to a string, the content will be duplicated based on the amount set in the 'duplicate' settings property. If set to an array, the duplicate property will be auto set based on the length of the array.
settings.duplicate:Number = 3 (optional)
The number of times to duplicate your content.
settings.delay:Number = 500 (optional)
The delay between changes.
settings.loop:Number = NaN (optional)
The amount of times to loop between changes. If set to 'NaN,' the loop will be infinite.
Details
Author
  • Leandro Silva

Members

settings:Object

Gets the current settings.

Methods

onChange(callback):SequenceRunner

Calls your function on every change.
Parameters
callback:SequenceRunner~onChangeCallback
The callback function.
Returns
Type
:SequenceRunner

onComplete(callback):SequenceRunner

Calls your function at the end of the loop (assuming you set a loop).
Parameters
callback:SequenceRunner~onCompleteCallback
The callback function.
Returns
Type
:SequenceRunner

pause():SequenceRunner

Pauses the sequence. This method clears the interval, but does not empty the HTML container(s).
Returns
Type
:SequenceRunner

start():SequenceRunner

Starts the sequence.
Returns
Type
:SequenceRunner

stop():SequenceRunner

Stops the sequence. This method clears the interval and empties the HTML container(s).
Returns
Type
:SequenceRunner

Type Definitions

onChangeCallback(content, count, loop)

The callback used by the 'onChange' method.
Parameters
content:*
The current content.
count:Number
The current tick/count.
loop:Number
The current loop.

onCompleteCallback(content, count, loop)

The callback used by the 'onComplete' method.
Parameters
content:*
The current content.
count:Number
The current tick/count.
loop:Number
The current loop.