Skip to content

Commit 10165ae

Browse files
committed
merge
2 parents 2a37987 + ff88ee2 commit 10165ae

File tree

1 file changed

+86
-3
lines changed

1 file changed

+86
-3
lines changed

README.md

Lines changed: 86 additions & 3 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
@@ -331,7 +409,9 @@ introJs().onafterchange(function(targetElement) {
331409
- `data-step`: Optionally define the number (priority) of step
332410
- `data-tooltipClass`: Optionally define a CSS class for tooltip
333411
- `data-highlightClass`: Optionally append a CSS class to the helperLayer
334-
- `data-position`: Optionally define the position of tooltip, `top`, `left`, `right`, `bottom`, `bottom-left-aligned` (same as 'bottom'), 'bottom-middle-aligned' and 'bottom-right-aligned'. Default is `bottom`
412+
- `data-position`: Optionally define the position of tooltip, `top`, `left`, `right`, `bottom`, `bottom-left-aligned` (same as `bottom`), `bottom-middle-aligned` and `bottom-right-aligned`. Default is `bottom`
413+
- `data-hint`: The tooltip text of hint
414+
- `data-hintPosition`: Optionally define the position of hint. Options: `top-middle`, `top-left`, `top-right`, `bottom-left`, `bottom-right`, `bottom-middle`. Default: `top-middle`
335415

336416
###Options:
337417

@@ -353,6 +433,9 @@ introJs().onafterchange(function(targetElement) {
353433
- `scrollToElement`: Auto scroll to highlighted element if it's outside of viewport, `true` or `false`
354434
- `overlayOpacity`: Adjust the overlay opacity, `Number`
355435
- `disableInteraction`: Disable an interaction inside element or not, `true` or `false`
436+
- `hintPosition`: Hint position. Default: `top-middle`
437+
- `hintButtonLabel`: Hint button label. Default: 'Got it'
438+
356439
357440
See [setOption](https://github.com/usablica/intro.js/#introjssetoptionoption-value) to see an example.
358441

0 commit comments

Comments
 (0)