Instead of a heavy calculation of a scroll offset, we can use `Use Element.scrollIntoView()` instead. **Docs:** * https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView **Examples:** * http://iamdustan.com/smoothscroll * https://codepen.io/askd/pen/jZZEeG
Instead of a heavy calculation of a scroll offset, we can use
Use Element.scrollIntoView()instead.Docs:
Examples: