JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
<button id="example">
click me
</button>
<div id="home" class="long-container">
long old container
</div>
<div id="about">
scroll to me
</div>
</body>
</html>
CSS
.long-container {
height: 600px;
background: yellow;
}
#about {
height: 600px;
background: green;
}
JavaScript
$(document).ready(() => {
$('#example').click(() => {
$('html,body').animate({
'scrollTop': $('#about').offset().top
}, 1500);
});
});