scroll to top jquery animate code example
Example 1: jquery scroll to top of div animate
$("#yourDivID").animate({scrollTop:0}, "smooth");
Example 2: jquery scrolltop animate
var body = $("html, body");
body.stop().animate({scrollTop:0}, 500, 'swing', function() {
alert("Finished animating");
});