I have the following javascript function that scrolls to top. How can i modify it in order to choose how slow or fast the page will scroll to top;
function topFunction() {
document.body.scrollTop = 0; // For Chrome, Safari and Opera
document.documentElement.scrollTop = 0; // For IE and Firefox
}