scroll-to-next
v0.0.1
Published
ScrollToNext scrolls to the next instance of a DOM element tag or class.
Downloads
1
Readme
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);
}
});