JSFiddle - React, Tailwind, and code Playground
HTML
<header>
<a href='#go'>scrollll too</a>
</header>
<section>
<a name='go'></a>
</section>
CSS
header{
height: 400px;
background: red;
}
section{
height: 700px;
background: #000;
}
JavaScript
$('a[href^="#"]').click(function () {
var elementClick = $(this).attr("href");
var destination = $(elementClick).offset().top;
if($.browser.safari){
$('body').animate( { scrollTop: destination }, 1100 );
}else{
$('html').animate( { scrollTop: destination }, 1100 );
}
return false;
})