Hierarchy

  • ScrollingData

Index

Constructors

constructor

  • elem: The element that should be scrolled pos: "scrollLeft" if the element should be scrolled on the horizontal axis, "scrollTop" otherwise

    Parameters

    Returns ScrollingData

Properties

duration

duration: number = 0

Private elem

elem: HTMLElement

endPos

endPos: number

Private pos

scrolling

scrolling: boolean = false

startPos

startPos: number

startTime

startTime: number

Methods

getStep

  • getStep(): number
  • Computes where the element should be. This changes depending on how long ago the first scrolling attempt was made. It might be useful to make this function more configurable by making it accept an argument instead of using performance.now()

    Returns number

scheduleStep

  • scheduleStep(): void
  • Calls this.scrollStep() until the element has been completely scrolled or the scrolling animation is complete

    Returns void

scroll

  • scroll(distance: number, duration: number): boolean

scrollStep

  • scrollStep(): boolean