|
1 |
| -Intro.js |
2 |
| -======== |
| 1 | +# Intro.js |
3 | 2 |
|
4 |
| -Better introductions for websites and features with a step-by-step guide for your projects. |
| 3 | +> Better introductions for websites and features with a step-by-step guide for your projects. |
5 | 4 |
|
6 |
| -##How to use |
| 5 | + |
| 6 | +## How to use |
7 | 7 | Intro.js can be added to your site in three simple steps:
|
8 | 8 |
|
9 | 9 | **1)** Include `intro.js` and `introjs.css` (or the minified version for production) in your page.
|
10 | 10 |
|
11 | 11 | **2)** Add `data-intro` and `data-step` to your HTML elements.
|
| 12 | + |
12 | 13 | For example:
|
| 14 | + |
13 | 15 | ```html
|
14 | 16 | <a href='http://google.com/' data-intro='Hello step one!' data-step='1'></a>
|
15 | 17 | ````
|
| 18 | + |
| 19 | +Optionally you can define `data-position` attribute to define the position of tooltip with values `top`, `right`, `left` and `bottom`. Default value is `bottom`. |
16 | 20 |
|
17 | 21 | **3)** Call this JavaScript function:
|
18 | 22 | ```javascript
|
19 | 23 | introJs().start();
|
20 | 24 | ````
|
21 | 25 |
|
22 |
| -Optionally, pass one parameter to `introJs` function to limit the presentation section, for example `introJs(".introduction-farm").start();` runs the introduction only for elements with `class='introduction-farm'`. |
| 26 | +Optionally, pass one parameter to `introJs` function to limit the presentation section. |
| 27 | + |
| 28 | +**For example** `introJs(".introduction-farm").start();` runs the introduction only for elements with `class='introduction-farm'`. |
| 29 | + |
| 30 | +<p align="center"><img src="http://usablica.github.com/intro.js/img/introjs-demo.png"></p> |
| 31 | + |
| 32 | +## API |
23 | 33 |
|
24 |
| -##Using with: |
| 34 | +###introJs([targetElm]) |
25 | 35 |
|
26 |
| -###Rails |
| 36 | +Creating an introJs object. |
| 37 | + |
| 38 | +**Available since**: v0.1.0 |
| 39 | + |
| 40 | +**Parameters:** |
| 41 | + - targetElm : String (optional) |
| 42 | + Should be defined to start introduction for specific element, for example: `#intro-farm`. |
| 43 | + |
| 44 | +**Returns:** |
| 45 | + - introJs object. |
| 46 | + |
| 47 | +**Example:** |
| 48 | +```javascript |
| 49 | +introJs() //without selector, start introduction for whole page |
| 50 | +introJs("#intro-farm") //start introduction for element id='intro-farm' |
| 51 | +```` |
| 52 | + |
| 53 | +###introJs.start() |
27 | 54 |
|
| 55 | +Start the introduction for defined element(s). |
| 56 | + |
| 57 | +**Available since**: v0.1.0 |
| 58 | + |
| 59 | +**Returns:** |
| 60 | + - introJs object. |
| 61 | + |
| 62 | +**Example:** |
| 63 | +```javascript |
| 64 | +introJs().start() |
| 65 | +```` |
| 66 | + |
| 67 | +###introJs.oncomplete(providedCallback) |
| 68 | + |
| 69 | +Set callback for when introduction completed. |
| 70 | + |
| 71 | +**Available since**: v0.2.0 |
| 72 | + |
| 73 | +**Parameters:** |
| 74 | + - providedCallback : Function |
| 75 | + |
| 76 | +**Returns:** |
| 77 | + - introJs object. |
| 78 | + |
| 79 | +**Example:** |
| 80 | +```javascript |
| 81 | +introJs().oncomplete(function() { |
| 82 | + alert("end of introduction"); |
| 83 | +}); |
| 84 | +```` |
| 85 | + |
| 86 | +###introJs.onexit(providedCallback) |
| 87 | + |
| 88 | +Set callback to exit of introduction. Exit also means pressing `ESC` key and clicking on the overlay layer by the user. |
| 89 | + |
| 90 | +**Available since:** v0.2.0 |
| 91 | + |
| 92 | +**Parameters:** |
| 93 | + - providedCallback : Function |
| 94 | + |
| 95 | +**Returns:** |
| 96 | + - introJs object. |
| 97 | + |
| 98 | +**Example:** |
| 99 | +```javascript |
| 100 | +introJs().onexit(function() { |
| 101 | + alert("exit of introduction"); |
| 102 | +}); |
| 103 | +```` |
| 104 | + |
| 105 | +## Using with: |
| 106 | + |
| 107 | +### Rails |
28 | 108 | If you are using the rails asset pipeline you can use the [introjs-rails](https://github.com/heelhook/intro.js-rails) gem.
|
29 | 109 |
|
30 |
| -###Yii framework |
| 110 | +### Yii framework |
31 | 111 | You can simply use this project for Yii framework: https://github.com/moein7tl/Yii-IntroJS
|
32 | 112 |
|
33 |
| -##Roadmap |
| 113 | + |
| 114 | +## Build |
| 115 | + |
| 116 | +First you should install `nodejs` and `npm`, then first run this command: `npm install` to install all dependencies. |
| 117 | + |
| 118 | +Now you can run this command to minify all static resources: |
| 119 | + |
| 120 | + make build |
| 121 | + |
| 122 | + |
| 123 | +## Roadmap |
34 | 124 | - More browser compatibility
|
35 |
| -- Adding ability to define tooltip position in each step, `top`, `left,` `right` and `bottom` |
36 |
| -- Fix overlay layer bug while using it in wide monitors and `document` object |
37 |
| -- Change `Next` and `Skip` buttons |
38 |
| -- Add complete introduction callback |
39 | 125 |
|
40 |
| -##Main Contributors |
41 |
| -- [Afshin Mehrabani](http://afshinm.name/) |
42 | 126 |
|
43 |
| -other contributors: https://github.com/usablica/intro.js/contributors |
| 127 | +## Release History |
| 128 | + * **v0.2.1** - 2013-03-20 |
| 129 | + - Fix keydown event unbinding bug. |
| 130 | + |
| 131 | + * **v0.2.0** - 2013-03-20 |
| 132 | + - Ability to define tooltip position with `data-position` attribute |
| 133 | + - Add `onexit` and `oncomplete` callback |
| 134 | + - Better scrolling functionality |
| 135 | + - Redesign navigating buttons + add previous button |
| 136 | + - Fix overlay layer bug in wide monitors |
| 137 | + - Fix show element for elements with position `absolute` or `relative` |
| 138 | + - Add `enter` key for navigating in steps |
| 139 | + - Code refactoring |
| 140 | + |
| 141 | + |
| 142 | + * **v0.1.0** - 2013-03-16 |
| 143 | + - First commit. |
| 144 | + |
| 145 | +## Author |
| 146 | +**Afshin Mehrabani** |
44 | 147 |
|
45 |
| -##Support/Discussion |
| 148 | +- [Twitter](https://twitter.com/afshinmeh) |
| 149 | +- [Github](https://github.com/afshinm) |
| 150 | +- [Personal page](http://afshinm.name/) |
46 | 151 |
|
| 152 | +[Other contributors](https://github.com/usablica/intro.js/graphs/contributors) |
| 153 | + |
| 154 | + |
| 155 | +## Support/Discussion |
47 | 156 | - [Google Group](https://groups.google.com/d/forum/introjs)
|
48 | 157 |
|
49 |
| -##License |
50 | 158 |
|
51 |
| - Copyright (C) 2012 Afshin Mehrabani ( [email protected]) |
52 |
| - |
53 |
| - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated |
54 |
| - documentation files (the "Software"), to deal in the Software without restriction, including without limitation |
55 |
| - the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, |
56 |
| - and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
57 |
| - The above copyright notice and this permission notice shall be included in all copies or substantial portions |
58 |
| - of the Software. |
59 |
| - |
60 |
| - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED |
61 |
| - TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
62 |
| - THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
63 |
| - CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
64 |
| - IN THE SOFTWARE. |
| 159 | +## License |
| 160 | +> Copyright (C) 2012 Afshin Mehrabani ( [email protected]) |
| 161 | + |
| 162 | +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated |
| 163 | +documentation files (the "Software"), to deal in the Software without restriction, including without limitation |
| 164 | +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, |
| 165 | +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
| 166 | +The above copyright notice and this permission notice shall be included in all copies or substantial portions |
| 167 | +of the Software. |
| 168 | + |
| 169 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED |
| 170 | +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 171 | +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| 172 | +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
| 173 | +IN THE SOFTWARE. |
0 commit comments