【文件属性】:
文件名称:animation-frame-event-listener
文件大小:46KB
文件格式:ZIP
更新时间:2021-04-13 10:35:28
JavaScript
动画帧事件监听器
在滚动/调整大小eventListener时具有更好的性能。
用法
import { addAnimationFrameEventListener , removeAnimationFrameEventListener } from 'animation-frame-event-listener' ;
const exampleCallBack = ( ) => {
console . log ( window . scrollY ) ;
} ;
// addEvent
addAnimationFrameEventListener ( window , 'scroll' , 'anyUniqueIdForEvent' , exampleCallBack ) ;
// removeEvent
removeAnimationFrameEventListener ( win
【文件预览】:
animation-frame-event-listener-master
----src()
--------animation-frame-event-listener.js(2KB)
----README.md(480B)
----.gitignore(17B)
----package-lock.json(208KB)
----package.json(962B)