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

    Keywords

    none

    Install

    npm i scroll-to-next

    DownloadsWeekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • umpc