0.0.1 • Published 7 years ago

scroll-to-next v0.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

ScrollToNext.js

ScrollToNext scrolls to the next instance of a DOM element tag or class.

No external dependencies are required.

Example

document.getElementById("next-article").addEventListener('click', function() {
  try {
    ScrollToNext(document.getElementsByTagName("article"), {
      behavior: 'smooth'
    });
  } catch(ex) {
    console.error(ex.message);
  }
});