Update scroll.ts
This commit is contained in:
parent
ee22820da2
commit
eb81813ebf
|
@ -45,7 +45,7 @@ export function onScrollTop(el: HTMLElement, cb: () => unknown, tolerance = 1, o
|
|||
|
||||
const container = getScrollContainer(el) ?? window;
|
||||
|
||||
const onScroll = ev => {
|
||||
const onScroll = () => {
|
||||
if (!document.body.contains(el)) return;
|
||||
if (isTopVisible(el, tolerance)) {
|
||||
cb();
|
||||
|
@ -69,7 +69,7 @@ export function onScrollBottom(el: HTMLElement, cb: () => unknown, tolerance = 1
|
|||
}
|
||||
|
||||
const containerOrWindow = container ?? window;
|
||||
const onScroll = ev => {
|
||||
const onScroll = () => {
|
||||
if (!document.body.contains(el)) return;
|
||||
if (isBottomVisible(el, 1, container)) {
|
||||
cb();
|
||||
|
|
Loading…
Reference in New Issue