dogs-and-capybaras-web-site/static/scripts/main.js

12 lines
391 B
JavaScript
Raw Normal View History

2023-10-11 17:06:22 +00:00
window.onscroll = function() {
if (document.body.scrollTop > 10 || document.documentElement.scrollTop > 10) {
document.getElementById("scrollToTopButton").style.display = "block";
} else {
document.getElementById("scrollToTopButton").style.display = "none";
}
};
function scrollToTop() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}