ScrollSum

Class to sum wheel events and know if that sum corresponds to a 'tick'.

Constructor

new ScrollSum()

Methods

add(event)

Add scroll.

Parameters:
NameTypeDescription
eventobject

The wheel event.

clear()

Clear the scroll sum.

getSum() → {number}

Get the scroll sum.

Returns:

The scroll sum.

Type: 
number

isTick() → {boolean}

Does the accumulated scroll correspond to a 'tick'.

Returns:

True if the sum corresponds to a 'tick'.

Type: 
boolean