getScrollPosition
Commons
stable
Returns the current scroll position (scrollLeft or scrollTop) of a SlideGroup element, with RTL correction applied for horizontal axes.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- isHorizontalrequiredboolean
- When true, returns the horizontal scroll position (scrollLeft); when false, returns scrollTop.
- isRtlrequiredboolean
- When true and horizontal, normalises the RTL scrollLeft value so that 0 always means "scrolled to the start of content".
- elementHTMLElement
- The scroll container element. Returns 0 when omitted.
API
Return value
The value returned by this util.
- The normalised scroll offset in pixels. Always 0 when element is absent.
Usage
Examples
Ready-to-paste usage snippets.
Read current scroll offset in a slide group