Created
December 4, 2025 10:27
-
-
Save estevan-ulian/0f76a59f9c3c06ed90e6dc8d3e0a1846 to your computer and use it in GitHub Desktop.
This code snippet makes a web page scroll smoothly from top to bottom. Adjust the `speed` variable according to your preference. Copy and paste it into your browser console to start.
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(){ | |
| let speed = 1; | |
| function autoScroll(){ | |
| window.scrollBy(0,speed); | |
| if((window.innerHeight+window.scrollY)<document.body.offsetHeight){ | |
| requestAnimationFrame(autoScroll); | |
| } | |
| } | |
| autoScroll(); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment