Skip to content

Instantly share code, notes, and snippets.

@reachjason
Created April 29, 2025 13:10
Show Gist options
  • Select an option

  • Save reachjason/a8d28df8ba78aa51c67f6d3e4dd721e6 to your computer and use it in GitHub Desktop.

Select an option

Save reachjason/a8d28df8ba78aa51c67f6d3e4dd721e6 to your computer and use it in GitHub Desktop.
(function scrollToBottom() {
const distance = 100; // pixels per scroll
const delay = 100; // milliseconds between scrolls
const scrollInterval = setInterval(() => {
window.scrollBy(0, distance);
if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight) {
clearInterval(scrollInterval);
console.log('Reached bottom of page.');
}
}, delay);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment