You can put this code in a document download, for example, to animate up
$("html, body").animate({ scrollTop: 0 }, 1000);
And you can animate to a specific element, for example
$("html, body").animate({ scrollTop: $('.my-element').offset().top }, 1000);
source share