Naivete Precedes Misrepresentation
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

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
      },
    },
  ]
})

install

npm i scroll-actions

Downloadsweekly downloads

7

version

0.1.1

license

ISC

last publish

collaborators

  • avatar
Report a vulnerability