Skip to content

Commit 7e139eb

Browse files
author
Simon he
committed
chore: add isBottom
1 parent 93c1f9b commit 7e139eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/isBottom.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export function isBottom(distance: number = 0): boolean {
2+
return document.documentElement.clientHeight + window.scrollY + distance >=
3+
(document.documentElement.scrollHeight || document.documentElement.clientHeight);
4+
5+
}

0 commit comments

Comments
 (0)