I am trying to get the HTML document to scroll slower. For example, this document scrolls at a constant rate determined by the browser:
div{
background-color:#00ffff;
}
<div style="height:3600px;">Try scrolling this container. Try scrolling this container. Try scrolling this container. Try scrolling this container. Try scrolling this container.</div>
But I an trying to modify the scroll speed:
document.onscroll = function(e) {
e.preventDefault();
window.scrollBy(0,2);
}
<div style="height:3600px;">scroll this container!</div>
But then, when the body is scrolling and the user stops scrolling, the content is still scrolling. Is there any problem with that code?