Skip to content

Stepwise JavaScript API Reference

Erik Loyer edited this page Jun 29, 2018 · 1 revision

Stepwise

Instantiation of the Stepwise jQuery plugin results in a Stepwise object, which is automatically assiged as a jQuery data property to the element on which the plugin was invoked, under the key "plugin_stepwise".

The simplest invocations of the plugin include only a target DOM element and a string which will be parsed into steps:

$("#output").stepwise("1 2 3 4");

See the Loading content section for details on additional methods and configuration options when initalizing the plugin. By default, Stepwise will set up input handling for clicks, touches, and keypresses.

Public Properties

Property Description
element The DOM element(s) associated with this instance of the plugin.
options Current configuration options of the plugin. Changing these after instantiation will have no effect.
score A Score object, which manages the content and state of the current story.

Public Methods

nextStep()

The nextStep() method causes the Stepwise object to execute the next step in the currently loaded script. The plugin calls this method automatically in response to user input; the only time you'll want to call it manually is if you want some other kind of event to trigger the next step in the current story.

Score

The Score object manages the content and state of the current story, and is created along with the root Stepwise instance.

Sequence

The Sequence object manages a group of steps objects which are to be triggered successively.

Step

The Step object represents a single step in a score.

Character

The Character object represents a single agent in a score.

Location

The Location object represents a geographical location in a score.

Clone this wiki locally