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()
{
$.when($('html,body').animate({scrollTop: 0}, 'slow')).then(function () {
alert('foo');
});
});
})