(el: HTMLElement | typeof window)
| 178 | // ------------------------------ |
| 179 | |
| 180 | export function getScrollTop(el: HTMLElement | typeof window): number { |
| 181 | if (isDocumentElement(el)) { |
| 182 | return window.pageYOffset; |
| 183 | } |
| 184 | return el.scrollTop; |
| 185 | } |
| 186 | |
| 187 | export function scrollTo(el: HTMLElement | typeof window, top: number): void { |
| 188 | // with a scroll distance, we perform scroll on the element |
no test coverage detected
searching dependent graphs…