Update scroll.ts

This commit is contained in:
syuilo 2024-08-31 09:56:01 +09:00
parent ee22820da2
commit eb81813ebf
1 changed files with 2 additions and 2 deletions

View File

@ -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();