This commit is contained in:
tamaina 2022-02-05 02:50:53 +09:00
parent 8913c751f0
commit af2603ef8a

View file

@ -29,7 +29,7 @@ export function onScrollTop(el: HTMLElement, cb: Function, asobi: number = 1, on
// とりあえず評価してみる // とりあえず評価してみる
if (isTopVisible(el)) { if (isTopVisible(el)) {
cb(); cb();
return null; if (once) return null;
} }
const container = getScrollContainer(el) || window; const container = getScrollContainer(el) || window;
@ -53,7 +53,7 @@ export function onScrollBottom(el: HTMLElement, cb: Function, asobi: number = 1,
// とりあえず評価してみる // とりあえず評価してみる
if (isBottomVisible(el, asobi, container)) { if (isBottomVisible(el, asobi, container)) {
cb(); cb();
return null; if (once) return null;
} }
const containerOrWindow = container || window; const containerOrWindow = container || window;