Created
April 29, 2025 13:10
-
-
Save reachjason/a8d28df8ba78aa51c67f6d3e4dd721e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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