1.0.1 • Published 6 years ago

scroll-speed-detection v1.0.1

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

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()