Skip to content

Commit 1a4bbf3

Browse files
author
Yaron Nachshon
committed
scroll support
1 parent c1bf5fe commit 1a4bbf3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

intro.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,19 @@
300300

301301
function showStep(step){
302302
var _showStep = function(){
303-
var element;
303+
var intro;
304304
hint = hint || new Hint();
305305
backdrop = backdrop || createBackdrop();
306306

307-
if(isFunction(step.element)){
308-
element = step.element();
307+
if(isFunction(step.intro)){
308+
intro = step.intro();
309309
}else{
310-
element = step.element;
310+
intro = step.intro;
311311
}
312-
hint.setTarget(element || $('body'));
312+
if(step.element){
313+
$(step.element).get(0).scrollIntoView();
314+
}
315+
hint.setTarget(step.element || $('body'));
313316
hint.setPosition(step.hintPosition);
314317
hint.setTooltipPosition(step.tooltipPosition);
315318
hint.setContent(step.intro);

0 commit comments

Comments
 (0)