Skip to content

Commit 078bc8d

Browse files
committed
Add API section
1 parent 73a5112 commit 078bc8d

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,78 @@ Optionally, pass one parameter to `introJs` function to limit the presentation s
2727

2828
<p align="center"><img src="http://usablica.github.com/intro.js/img/introjs-demo.png"></p>
2929

30+
## API
31+
32+
###introJs([targetElm])
33+
34+
Creating an introJs object.
35+
36+
**Available since**: v0.1.0
37+
38+
**Parameters:**
39+
- targetElm : String (optional)
40+
Should be defined to start introduction for specific element, for example: `#intro-farm`.
41+
42+
**Returns:**
43+
- introJs object.
44+
45+
**Example:**
46+
```javascript
47+
introJs() //without selector, start introduction for whole page
48+
introJs("#intro-farm") //start introduction for element id='intro-farm'
49+
````
50+
51+
###introJs.start()
52+
53+
Start the introduction for defined element(s).
54+
55+
**Available since**: v0.1.0
56+
57+
**Returns:**
58+
- introJs object.
59+
60+
**Example:**
61+
```javascript
62+
introJs().start()
63+
````
64+
65+
###introJs.oncomplete(providedCallback)
66+
67+
Set callback for when introduction completed.
68+
69+
**Available since**: v0.2.0
70+
71+
**Parameters:**
72+
- providedCallback : Function
73+
74+
**Returns:**
75+
- introJs object.
76+
77+
**Example:**
78+
```javascript
79+
introJs().oncomplete(function() {
80+
alert("end of introduction");
81+
});
82+
````
83+
84+
###introJs.onexit(providedCallback)
85+
86+
Set callback to exit of introduction. Exit also means pressing `ESC` key and clicking on the overlay layer by the user.
87+
88+
**Available since:** v0.2.0
89+
90+
**Parameters:**
91+
- providedCallback : Function
92+
93+
**Returns:**
94+
- introJs object.
95+
96+
**Example:**
97+
```javascript
98+
introJs().onexit(function() {
99+
alert("exit of introduction");
100+
});
101+
````
30102

31103
## Using with:
32104

0 commit comments

Comments
 (0)