Skip to content

Commit 781354a

Browse files
committed
Adding "hint" functions/events. Change version number to 2.0
1 parent b1e5ef2 commit 781354a

File tree

1 file changed

+80
-2
lines changed

1 file changed

+80
-2
lines changed

README.md

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Intro.js
1+
# Intro.js v2.0
22

33
> Better introductions for websites and features with a step-by-step guide for your projects.
44
@@ -21,7 +21,7 @@ Intro.js can be added to your site in three simple steps:
2121

2222
> CDN hosted files are available at [jsDelivr](http://www.jsdelivr.com/#!intro.js) (click Show More) & [cdnjs](http://cdnjs.com/#introjs).
2323
24-
**2)** Add `data-intro` and `data-step` to your HTML elements.
24+
**2)** Add `data-intro` and `data-step` to your HTML elements. To add hints you should use `data-hint` attribute.
2525

2626
For example:
2727

@@ -220,6 +220,84 @@ introJs().refresh();
220220

221221
----
222222

223+
###introJs.addHints()
224+
225+
To add available hints to the page (using `data-hint` or JSON)
226+
227+
**Available since**: v2.0
228+
229+
**Returns:**
230+
- introJs object.
231+
232+
**Example:**
233+
```javascript
234+
introJs().addHints();
235+
````
236+
237+
-----
238+
239+
###introJs.onhintclick(providedCallback)
240+
241+
Invkoes given function when user clicks on one of hints.
242+
243+
**Available since**: v2.0
244+
245+
**Parameters:**
246+
- providedCallback : Function
247+
248+
**Returns:**
249+
- introJs object.
250+
251+
**Example:**
252+
```javascript
253+
introJs().onhintclick(function() {
254+
alert("hint clicked");
255+
});
256+
````
257+
258+
-----
259+
260+
###introJs.onhintsadded(providedCallback)
261+
262+
Invokes given callback function after adding and rendering all hints.
263+
264+
**Available since**: v2.0
265+
266+
**Parameters:**
267+
- providedCallback : Function
268+
269+
**Returns:**
270+
- introJs object.
271+
272+
**Example:**
273+
```javascript
274+
introJs().onhintsadded(function() {
275+
alert("all hints were added");
276+
});
277+
````
278+
279+
-----
280+
281+
###introJs.onhintclose(providedCallback)
282+
283+
Set callback for when a single hint removes from page (e.g. when user clicks on "Got it" button)
284+
285+
**Available since**: v2.0
286+
287+
**Parameters:**
288+
- providedCallback : Function
289+
290+
**Returns:**
291+
- introJs object.
292+
293+
**Example:**
294+
```javascript
295+
introJs().onhintclose(function() {
296+
alert("hint closed");
297+
});
298+
````
299+
300+
-----
223301
224302
###introJs.oncomplete(providedCallback)
225303

0 commit comments

Comments
 (0)