Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Ui/scrollToPosition

Index

Functions

Functions

scrollToPosition

  • scrollToPosition(position: number, duration?: number, container?: HTMLElement | Window | string, breakOnManualScroll?: boolean): Promise<HTMLElement | Window | string | undefined>
  • Can be used to scroll either a container or the whole window to a given position using a smooth animation

    Parameters

    • position: number

      The pixel position on the Y axis to scroll to

    • Optional duration: number

      (Default 300) The duration in milliseconds the animation should take

    • Optional container: HTMLElement | Window | string

      (Default window) The container to scroll instead of the window.

    • Optional breakOnManualScroll: boolean

      (Default true) By default the animation is stopped when the user manually starts to interact with the scrolling. If you set this to false the scrolling will continue even on interaction Can be a valid selector for document.querySelector() as a string, as well.

    Returns Promise<HTMLElement | Window | string | undefined>

Generated using TypeDoc