1.0.0 • Published 6 years ago

just-scroll.js v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

Just Scroll

Just Scroll is a javascript package for ease-out-in Scrolling in browsers, NO more than that.

Usage

  • With npm
import justScroll from 'just-scroll';
  • With requirejs
require(['dist/just-scroll.umd.js'], function (m) {
  var justScroll = m.default;
})

Arguments

justScroll(el, scrollY[, options])

In options:

  • options.duration

    Seconds to wait until scrolling finished.

  • options.onFinish

    The Event that is triggered when scrolling finish.

    justScroll(el, y, {
      onFinish (
        positionY, // Current scroll position
        scrollHeight // total height of the container
      ) {
        // some operations
      }
    })
  • options.onScroll

    The Event that is triggered at each pace while scrolling.

    justScroll(el, y, {
      onScroll (
        positionY, // Current scroll position
        scrollHeight // total height of the container
      ) {
        // some operations
      }
    })