Scrolling with JavaScript¶
It’s possible to use JavaScript to scroll the window
window.scrollTo(0, 1000)
That says to scroll the window horizontally no pixels and to scroll down the page 1000 pixels. However this will be executed instantly and the effect could be jarring for the user so we can make this happen “smoothly” like so
window.scrollTo({left: 0, top: 1000, behaviour: 'smooth'})