scrolling-observer
v1.0.9
Published
A Simple JS library that detects mobile app is scrolling or not.
Downloads
22
Readme
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() // 初始化
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