@manhng

Welcome to my blog!

Scroll Back To Top Button

June 5, 2020 11:14

Scroll Back To Top Button (edit)

function topFunction() {
  document.body.scrollTop = 0; // For Safari
  document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}

https://www.w3schools.com/howto/howto_js_scroll_to_top.asp

https://stackoverflow.com/questions/1144805/scroll-to-the-top-of-the-page-using-javascript

https://www.w3schools.com/jsref/met_win_scrollto.asp

https://www.w3schools.com/jsref/prop_element_scrolltop.asp

https://css-tricks.com/need-to-scroll-to-the-top-of-the-page/

Categories

Recent posts