Skip to content

Commit 49abc26

Browse files
committed
check if the target element is visible or not, fixes usablica#233
1 parent 9d6a369 commit 49abc26

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

intro.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,16 @@
7878
for (var i = 0, stepsLength = this._options.steps.length; i < stepsLength; i++) {
7979
var currentItem = _cloneObject(this._options.steps[i]);
8080
//set the step
81-
currentItem.step = i + 1;
81+
currentItem.step = introItems.length + 1;
8282
//use querySelector function only when developer used CSS selector
8383
if (typeof(currentItem.element) === 'string') {
8484
//grab the element with given selector from the page
8585
currentItem.element = document.querySelector(currentItem.element);
8686
}
87-
introItems.push(currentItem);
87+
88+
if (currentItem.element != null) {
89+
introItems.push(currentItem);
90+
}
8891
}
8992

9093
} else {

0 commit comments

Comments
 (0)