This commit is contained in:
tamaina 2023-07-11 12:36:45 +00:00
parent 9f246e3dc7
commit 5f1cd1e532
2 changed files with 21 additions and 13 deletions

View file

@ -25,7 +25,7 @@ export function getScrollPosition(el: HTMLElement | null): number {
export function onScrollTop(el: HTMLElement, cb: () => unknown, tolerance = 1, once = false) {
// とりあえず評価してみる
if (isTopVisible(el)) {
if (isTopVisible(el, tolerance)) {
cb();
if (once) return null;
}