1

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?

no ai please
  • 732
  • 3
  • 11
  • 24
  • 2
    does this help? https://stackoverflow.com/questions/7408100/can-i-change-the-scroll-speed-using-css-or-jquery – Tony Zhang May 08 '21 at 20:58

0 Answers0