scroll-to-next

0.0.1 • Public • Published

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);
  }
});

Readme

Keywords

none

Package Sidebar

Install

npm i scroll-to-next

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • umpc