Skip to main content

.smooth

.smooth( duration:Number ) : Number | self

Gets/Sets the number of seconds it takes to catch up to the scroll position (smoothing).

Parameters

  • duration: Number

    The number of seconds that it should take to "catch up" to the native scroll position.

Returns : Number | self

The number of seconds it takes to catch up to the scroll position (if getter) or the ScrollSmoother instance itself (if setter) for easier chaining

Details

Gets/Sets the number of seconds it takes to catch up to the scroll position (smoothing).

// setter
smoother.smooth(1.5);

// getter
let duration = smoother.smooth();