Function scrollToPosition

Scroll window or other scrollable element to given position

  • Parameters

    • x: number

      Horizontal position to scroll to

    • y: number

      Vertical position to scroll to

    • smoothScroll: boolean = true

      Enable smooth scroll if supported, true by default

    • target: HTMLElement | Window = window

      Target to be scrolled, window by default

    Returns void

    void