Index

Type aliases

scrollingDirection

scrollingDirection: "scrollLeft" | "scrollTop"

Variables

Const horizontallyScrolling

horizontallyScrolling: Map<Node, ScrollingData> = new Map<Node, ScrollingData>()

Let lastRecursiveScrolled

lastRecursiveScrolled: any = null

Let lastX

lastX: number = 0

Let lastY

lastY: number = 0

Const verticallyScrolling

verticallyScrolling: Map<Node, ScrollingData> = new Map<Node, ScrollingData>()

Functions

getDuration

  • getDuration(): Promise<any>

getSmooth

  • getSmooth(): Promise<any>

recursiveScroll

  • recursiveScroll(x: number, y: number, node?: Element, stopAt?: Element): Promise<boolean>
  • Tries to find a node which can be scrolled either x pixels to the right or y pixels down among the Elements in {nodes} and children of these Elements.

    This function used to be recursive but isn't anymore due to various attempts at optimizing the function in order to reduce GC pressure.

    Parameters

    • x: number
    • y: number
    • Optional node: Element
    • Optional stopAt: Element

    Returns Promise<boolean>

scroll

  • scroll(x?: number, y?: number, e: Node, duration?: number): Promise<boolean>
  • Tries to scroll e by x and y pixel, make the smooth scrolling animation last duration milliseconds

    Parameters

    • Default value x: number = 0
    • Default value y: number = 0
    • e: Node
    • Optional duration: number

    Returns Promise<boolean>

Object literals

Const opts

opts: object

duration

duration: null = null

smooth

smooth: null = null