JSFiddle - React, Tailwind, and code Playground
HTML
<div>
Scroll down and click on anchor.
</div>
<div class="space">
</div>
<a href="#" id="drop-user-box" class="drop-user-box">Drop this mofo</a>
CSS
.space
{
height: 2000px;
}
JavaScript
$(document).ready(function()
{
$("a#drop-user-box").click(function()
{
$("html, body").animate({scrollTop: 0}, "slow")
.promise().then(function() {
alert("foo");
});
return false;
});
})