Hierarchy

  • ScrollingData

Index

Constructors

constructor

Properties

duration

duration: number = 0

Private elem

elem: Node

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
  • Updates the position of this.elem, returns true if the element has been scrolled, false otherwise.

    Returns boolean