Skip to content

Commit 957a7c4

Browse files
author
sshulzhitskaya
committed
Issue: #82, #73 Scroll not working anymore on latest version of chrome
1 parent e3ed6c6 commit 957a7c4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/enjoyhint.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,15 @@ var EnjoyHint = function (configs) {
147147

148148
that.clear();
149149
}, 250);
150-
151-
$(document.body).scrollTop(step_data.selector, step_data.scrollAnimationSpeed || 250, {offset: -100});
152-
150+
151+
152+
//$(document.body).scrollTop(step_data.selector, step_data.scrollAnimationSpeed || 250, {offset: -100});
153+
var elemToScroll = document.querySelector(step_data.selector);
154+
if(elemToScroll){
155+
let {x, y} = elemToScroll.getClientRects();
156+
window.scrollTo(x, y);
157+
}
158+
153159
setTimeout(function () {
154160

155161
var $element = $(step_data.selector);

0 commit comments

Comments
 (0)