Leo555 / scrolling-observer

A Simple JS library that detects mobile app is scrolling or not.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NPM version Build Status npm download GitHub license PRs Welcome

scrolling-observer

A Simple JS library that detects mobile app is scrolling or not.

To solve JavaScript Scroll Event Delay,for example Bootstrap issue #16202

Example

html script

<script src="../dist/sscrolling-observer.min.js"></script>
<script>
  var scroll = window['scrolling-observer'].default() // init
  setInterval(() => {
    if (scroll.isScrolling) {
      console.log(scroll.isScrolling, new Date().getTime())
    }
  }, 50)
</script>

npm:

$ npm install --save

JavaScript

import scroll from 'scrolling-observer'

// init
scroll()

// check
console.log(scroll().isScrolling)

// destroy
scroll().destroy()

License

MIT

About

A Simple JS library that detects mobile app is scrolling or not.

License:MIT License


Languages

Language:JavaScript 83.5%Language:HTML 16.5%