Skip to content

Commit 4742660

Browse files
Merge pull request #1384 from docsifyjs/fix/1383
Fix scroll event end value
2 parents 7f0c42e + b45f444 commit 4742660

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/event/scroll.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ function scrollTo(el, offset = 0) {
1818
enableScrollEvent = false;
1919
scroller = new Tweezer({
2020
start: window.pageYOffset,
21-
end: el.getBoundingClientRect().top + window.pageYOffset - offset,
21+
end:
22+
Math.round(el.getBoundingClientRect().top) + window.pageYOffset - offset,
2223
duration: 500,
2324
})
2425
.on('tick', v => window.scrollTo(0, v))

0 commit comments

Comments
 (0)