Skip to main content

.paused

.paused( pause:Boolean ) : Boolean | self

Gets/Sets the paused state - if true, nothing will scroll (except via scrollTop() or scrollTo() on this instance).

Parameters

  • pause: Boolean

    If true, it will immediately stop scrolling. If false, it will resume.

Details

Gets/Sets the paused state - if true, nothing will scroll (except via scrollTop() or scrollTo() on this instance).

Pausing immediately stops movement and prevents the user from even moving the scrollbar.

// setter
smoother.paused(true);

// getter
if (!smoother.paused()) {
// do stuff...
}

You could toggle, for example, like this:

document.querySelector("#toggle").addEventListener("click", () => {
// toggle!
smoother.paused(!smoother.paused());
});

Contents