Skip to content

Function: getScrollTop() ​

ts
function getScrollTop(element): number;

Get the scroll position.

Parameters ​

ParameterTypeDescription
elementHTMLElement | WindowScroll container element or window object.

Returns ​

number

The scroll position.

Example ​

ts
console.log(getScrollTop(window))

Since ​

1.0.0

Released under the MIT License.