Skip to content

castrofernandez/scrolltome

Repository files navigation

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.