momentum

v4.0.0
Add momentum to any DOM element with a simple API. It's like iScroll, except not for scrolling anything. `momentum` also supports mouse and touch events.

Momentum Travis

Add momentum to any DOM element with a simple API. It's like iScroll, except not for scrolling anything. momentum also supports mouse and touch events.

const momentum = require('momentum')

// make sure the element is in the document and the document is fully loaded
window.addEventListener('DOMContentLoaded', () => {
  const box = document.querySelector('box')
  momentum(box, (x, y) => {
    console.log('x:', x, 'y:', y)
  })
})

NPM

npm i momentum

Metadata

Downloads