0.3.1 • Published 5 years ago

webscrollingistheworst v0.3.1

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

WebScrollingIsTheWorst

Docs

  • new WebScrollingIsTheWorst();

    • onWindowTouchBottom(callback): unsubscriber

      • callback: a function that will be executed when the scroll touches the bottom of the page.
      • unsubscriber: a function to unsubscribe the callback.
    • onWindowTouchTop(callback): unsubscriber

      • callback: a function that will be executed when the scroll touches the top of the page.
      • unsubscriber: a function to unsubscribe the callback.
    • onScrollMoveUp(callback):unsubscriber

      • callback: a function that will be executed when the scroll moves upward.
      • unsubscriber: a function to unsubscribe the callback.
* onScrollMoveDown(callback):unsubscriber
  * callback: a function that will be executed when the scroll moves downward.
  * unsubscriber: a function to unsubscribe the callback.

* onScrollMove(callback):unsubscriber
  * callback: a function that will be executed when the scroll moves in any direction.
  * unsubscriber: a function to unsubscribe the callback.

* scrollToTop(duration?: number, stepSize?: number)
  * duration?: how long should it take to get to the top in milliseconds.
  * stepSize?: how rough or smooth is the trip.

* scrollToBottom(duration?: number, stepSize?: number)
  * duration?: how long should it take to get to the bottom in milliseconds.
  * stepSize?: how rough or smooth is the trip.

* isOnBottom(): isit
  * isit: true if scroll already on bottom.

* isOnTop(): isit
  * isit: true if scroll already on top.

Example

import {WebScrollingIsTheWorst} from "../dist/index.js";
let wsitw = new WebScrollingIsTheWorst();
wsitw.onWindowTouchBottom(() => {
    alert("You touched me bottom!😳");
});

wsitw.onWindowTouchTop(() => {
    alert("You touched me hat!🤭");
});

See demo directory for a working demo.

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1-0

5 years ago

0.2.0-0

5 years ago

0.1.2-3

5 years ago

0.1.2-2

5 years ago

0.1.2-1

5 years ago

0.1.0-alpha

5 years ago