Skip to content

Instantly share code, notes, and snippets.

@estevan-ulian
Created December 4, 2025 10:27
Show Gist options
  • Select an option

  • Save estevan-ulian/0f76a59f9c3c06ed90e6dc8d3e0a1846 to your computer and use it in GitHub Desktop.

Select an option

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.
(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