Skip to content

Function: getScrollLeft()

ts
function getScrollLeft(element): number;

Get the horizontal scroll position.

Parameters

ParameterTypeDescription
elementHTMLElement | WindowScroll container element or window object.

Returns

number

The horizontal scroll position.

Example

ts
console.log(getScrollLeft(window))

Since

1.0.0

Released under the MIT License.