getScrollPosition

Commons
stable

Returns the current scroll position (scrollLeft or scrollTop) of a SlideGroup element, with RTL correction applied for horizontal axes.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

isHorizontal
requis
boolean
When true, returns the horizontal scroll position (scrollLeft); when false, returns scrollTop.
isRtl
requis
boolean
When true and horizontal, normalises the RTL scrollLeft value so that 0 always means "scrolled to the start of content".
element
HTMLElement
The scroll container element. Returns 0 when omitted.

API

Valeur de retour

La valeur retournée par cet util.

The normalised scroll offset in pixels. Always 0 when element is absent.

Usage

Exemples

Extraits de code prêts à coller.

Read current scroll offset in a slide group

typescript