Is there any way to adjust Element.scrollIntoView()
scrolling speed with defined transition animation as behavior: "smooth"
. Somehow, scrolling is too slow in Chrome, but fine in Firefox.
Element.scrollIntoView() method animation speed too slow in Chrome
Asked Answered
The same thing happened to me and my problem came from the fact that I was calling Element.scrollIntoView()
from within a "scroll" event-handler.
The thing is scrollIntoView()
does trigger the scroll Event and so calling it within a scroll event handler creates an (almost) infinite loop.
What's the best way to solve this problem? (when you need to call scrollIntoView() from "scroll" event-handler) –
Ornithosis
What would be the point of scrollIntoView that's not on a scroll event? Just having some random content scrolling in on page load? Surely most people would have this on a scroll event, no? –
Truehearted
© 2022 - 2024 — McMap. All rights reserved.
window.scrollTo()
. I mean, do they implement the same algos for animation? – Bethea