|
72 | 72 | /* Default hint position */
|
73 | 73 | hintPosition: 'top-middle',
|
74 | 74 | /* Hint button label */
|
75 |
| - hintButtonLabel: 'Got it' |
| 75 | + hintButtonLabel: 'Got it', |
| 76 | + /* Adding animation to hints? */ |
| 77 | + hintAnimation: true |
76 | 78 | };
|
77 | 79 | }
|
78 | 80 |
|
|
1243 | 1245 | currentItem.element = document.querySelector(currentItem.element);
|
1244 | 1246 | }
|
1245 | 1247 |
|
1246 |
| - currentItem.hintPosition = currentItem.hintPosition || 'top-middle'; |
| 1248 | + currentItem.hintPosition = currentItem.hintPosition || this._options.hintPosition; |
| 1249 | + currentItem.hintAnimation = currentItem.hintAnimation || this._options.hintAnimation; |
1247 | 1250 |
|
1248 | 1251 | if (currentItem.element != null) {
|
1249 | 1252 | this._introItems.push(currentItem);
|
|
1260 | 1263 | for (var i = 0, l = hints.length; i < l; i++) {
|
1261 | 1264 | var currentElement = hints[i];
|
1262 | 1265 |
|
| 1266 | + // hint animation |
| 1267 | + var hintAnimation = currentElement.getAttribute('data-hintAnimation'); |
| 1268 | + |
| 1269 | + if (hintAnimation) { |
| 1270 | + hintAnimation = (hintAnimation == 'true'); |
| 1271 | + } else { |
| 1272 | + hintAnimation = this._options.hintAnimation; |
| 1273 | + } |
| 1274 | + |
1263 | 1275 | this._introItems.push({
|
1264 | 1276 | element: currentElement,
|
1265 | 1277 | hint: currentElement.getAttribute('data-hint'),
|
1266 | 1278 | hintPosition: currentElement.getAttribute('data-hintPosition') || this._options.hintPosition,
|
| 1279 | + hintAnimation: hintAnimation, |
1267 | 1280 | tooltipClass: currentElement.getAttribute('data-tooltipClass'),
|
1268 | 1281 | position: currentElement.getAttribute('data-position') || this._options.tooltipPosition
|
1269 | 1282 | });
|
|
1376 | 1389 |
|
1377 | 1390 | hint.className = 'introjs-hint';
|
1378 | 1391 |
|
| 1392 | + if (!item.hintAnimation) { |
| 1393 | + hint.className += ' introjs-hint-no-anim'; |
| 1394 | + } |
| 1395 | + |
1379 | 1396 | // hint's position should be fixed if the target element's position is fixed
|
1380 | 1397 | if (_isFixed(item.element)) {
|
1381 | 1398 | hint.className += ' introjs-fixedhint';
|
|
0 commit comments