Interface ScrollToOptions

interface ScrollToOptions {
    altOffset?: CoordinateOffset;
    altTarget?: string | Element | TargetCoordinates;
    duration?: number;
    offset?: CoordinateOffset;
    scrollable?: Element;
    userCanInterrupt?: boolean;
    weCanInterrupt?: boolean;
}

Properties

altOffset?: CoordinateOffset

Offset the target coordinates by the given amount(s) when altTarget is used.

See ScrollToOptions.offset.

undefined
altTarget?: string | Element | TargetCoordinates

If the scrolling element is already at the given coordinates (or strictly speaking we allow for 5 pixels difference), then if altTarget is given, this will become the target to scroll to.

undefined
duration?: number

The duration of the scroll animation. If not given, it is instant.

0

Offset the target coordinates by the given amount(s).

E.g. if the final target coordinates are computed to be {top: 100, left: 0} and you specify offset as {top: 10, left: 20}, it will scroll to {top: 110, left: 20}.

undefined
scrollable?: Element

The element that should be scrolled.

If document.body is scrollable, will use that; otherwise document.scrollingElement

userCanInterrupt?: boolean

Whether a user attempt to scroll the target can interrupt this before it finishes.

false
weCanInterrupt?: boolean

Whether another request to us to scroll the same target can interrupt this scroll before it finishes.

false