Conventional way
const hoge = hoge.getBoundingClientRect(); window.scrollTo({ left : hoge.left + window.pageXOffset, top: hoge.top + window.pageYOffset, behavior: 'smooth',
})
Recently way
hoge.scrollIntoView({behavior: "smooth"})
Viewport version
document.documentElement.clientHeight
Discover more from Coursity
Subscribe to get the latest posts sent to your email.