mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-12-02 03:59:19 +08:00
Merge pull request #1384 from docsifyjs/fix/1383
Fix scroll event end value
This commit is contained in:
commit
474266051c
@ -18,7 +18,8 @@ function scrollTo(el, offset = 0) {
|
||||
enableScrollEvent = false;
|
||||
scroller = new Tweezer({
|
||||
start: window.pageYOffset,
|
||||
end: el.getBoundingClientRect().top + window.pageYOffset - offset,
|
||||
end:
|
||||
Math.round(el.getBoundingClientRect().top) + window.pageYOffset - offset,
|
||||
duration: 500,
|
||||
})
|
||||
.on('tick', v => window.scrollTo(0, v))
|
||||
|
Loading…
Reference in New Issue
Block a user