Skip to content

getScrollTop ​

Gets the vertical scroll position of an element or window.

Usage ​

ts
import { getScrollTop } from 'rattail'

const scrollTop = getScrollTop(window)

Arguments ​

ArgTypeDefaults
elementElement | Window

Return ​

Type
number