scroll...
This commit is contained in:
parent
054ea30955
commit
fd44a29f2b
2 changed files with 18 additions and 1 deletions
|
|
@ -83,6 +83,19 @@ export function scroll(el: HTMLElement | null, options: ScrollToOptions | undefi
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* コンテナを指定してscrollByする
|
||||
* @param el Container element
|
||||
* @param options ScrollToOptions
|
||||
*/
|
||||
export function scrollBy(el: HTMLElement | null, options: ScrollToOptions | undefined) {
|
||||
if (el == null) {
|
||||
window.scrollBy(options);
|
||||
} else {
|
||||
el.scrollBy(options);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scroll to Top
|
||||
* @param el Scroll container element
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue