wip
This commit is contained in:
parent
9f246e3dc7
commit
5f1cd1e532
2 changed files with 21 additions and 13 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue