usablica/intro.js — pull request #86 by juristr (2013-03-31 13:44:40+00:00)
Title: added ability to allow programmatic configuration of steps

Here's a pull request to allow programmatic configuration of the steps (as described already in #71) as an alternative to the `data-*` annotations.

## Motivation

When you create single-page applications you usually distribute your views among multiple files and thus it would spread your step configs among them. Instead, I'd prefer to do the step configuration at one point in my application (i.e. in the startup procedure file) and apply it once my application is fully loaded.

## Usage

```javascript
var intro = introJs();
intro.setOptions({
steps: [
{
element: document.getElementById('step1'),
intro: "Hello all! :) This project's called Intro.js."
},
{
element: document.getElementById('step2'),
intro: "Ok, wasn't that fun?",
position: 'right'
},
...
]
});

intro.start();
```
Note, that programmatic configuration is mutually exclusive to the `data-*` approach, meaning you cannot mix both approaches (as of now).