For a super simple js scroll to element, this works pretty well:
```js
document.querySelector('#yourElement').scrollIntoView({
behavior: 'smooth',
block: 'start'
});
```
But if you want fancy easing, you’ll need to roll your own or use a lib. Check out https://greensock.com/scrolltoplugin/ for GSAP’s solution—it’s worth the small footprint.
```js
document.querySelector('#yourElement').scrollIntoView({
behavior: 'smooth',
block: 'start'
});
```
But if you want fancy easing, you’ll need to roll your own or use a lib. Check out https://greensock.com/scrolltoplugin/ for GSAP’s solution—it’s worth the small footprint.
