scroll-behaviour

1 · Christian · June 1, 2021, 9:02 a.m.
Scrolling/Jumping to a specific part of a webpage can be achieved in various ways, and with different bevaviours. E.g. JavaScript CSS HTML With JavaScript You can use the CSSOM scrolling APIs window.scrollTo(x-coord, y-coord)window.scrollTo(options) E.g. window.scrollTo({ top: 100, left: 100, behavior: 'smooth'}) With CSS Additionally, you can use the CSS property scroll-behaviour set to smooth (different from auto). It overrides the scroll behaviour via JavaScript and it can be a real nigh...