scroll-actions

0.1.1 • Public • Published

scroll-actions

Actions on scrolling to an element

import scrollActions from 'scroll-actions'
 
scrollActions({
  actions: [
    {
      selectors: ['#some-element'],
      onEnter: (el) => {
        // #some-element entered view
      },
      onLeave: (el) => {
        // #some-element left view
      },
    },
  ]
})

Readme

Keywords

Package Sidebar

Install

npm i scroll-actions

Weekly Downloads

0

Version

0.1.1

License

ISC

Last publish

Collaborators

  • adekbadek