npm.io
1.0.2 • Published 6 years ago

scrolltome

Licence
MIT
Version
1.0.2
Deps
1
Size
95 kB
Vulns
0
Weekly
0

scrolltome

Library to manage if an element is in ViewPort

  1. Install
npm install scrolltome
  1. Usage
scrolltome.subscribe({
    element: document.getElementById('section1'),
    inViewPortHandler: (data) => console.log(data),
    outOfViewPortHandler: (data) => console.log(data),
    repeat: 'FIRST_OUT',
});
  1. Development
npm run dev

This watches files and compiles them

  1. Run tests
npm run dev
npm start // or node server.js
npm test

npm run dev should be running to watch and recompile files.