0

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
}
33528
  • 372
  • 6
  • 12
  • 30
  • @AlonEitan this answer and commentary should be as famous as cthulhu-parse-html-with-regex http://stackoverflow.com/a/42263472/5087125 – pvg Apr 30 '17 at 19:29
  • so how should i change my function? – 33528 Apr 30 '17 at 19:36

0 Answers0