Skip to content

Commit 5574dd2

Browse files
author
Simon he
committed
fix: scrollToTop
1 parent 3a73aed commit 5574dd2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/scrollToTop.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export function scrollToTop() {
66
const t = document.documentElement.scrollTop || document.body.scrollTop
77
if (pre === undefined)
88
pre = t
9-
if (pre + 5 < t || t === 0)
9+
if ((pre + 5 < t && t < pre * 8 / 7) || t === 0)
1010
stop()
11-
window.scrollTo(0, pre = t - t / 8)
11+
window.scrollTo(0, pre = 7 * t / 8)
1212
}, 0)
1313
}
1414
catch (error: any) {

0 commit comments

Comments
 (0)