scroll-speed-detection

1.0.1 • Public • Published

scroll-speed-detection


Installation

npm install scroll-speed-detection

Usage

import { startListener, stopListener } from 'scroll-speed-detection'
/**
 * @limit Number Trigger succ function threshold. 触发 succ 函数的临界值 default: 100 px
 * @time Number Monitoring time. 监听的时间 default: 300 ms  函数 300 ms 触发一次
 * @succ Function(指定时间内 scroll 距离超过limit 触发 succ)
 * @fail Function(指定时间内 scroll 未距离超过limit 触发 fail)
 */
startListener({
    limit,
    time,
    succ,
    fail
})
 
// remove window scroll listener
stopListener()

Readme

Keywords

Package Sidebar

Install

npm i scroll-speed-detection

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

2.16 kB

Total Files

3

Last publish

Collaborators

  • mychaos95