Is there a way to speed up the behavior speed of scrollTo?
I can't find anything on it, which makes me think not. But If anyone knows better...
I had a stab in the dark at speed
and duration
, but no go.
window.scrollTo({
top: 1000,
behavior: "smooth"
});
https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo
You could use an interval timer to implement your own scrolling or use jQuery's animation library such as detailed in:
https://stackoverflow.com/a/38572744/9510069
Pure javascript solution, see the example below:
https://jsfiddle.net/rafarolo/zwkesrxh/3/
Minified version: https://jsfiddle.net/rafarolo/8orw7ak3/3/
Just change the second parameter from
scrollTopTo
function to refine your speed control.Minified version:
Reference: