bobatheme/assets/js/back-to-top.js
2021-11-22 20:49:11 -06:00

9 lines
280 B
JavaScript

const backToTop = document.getElementById("back-to-top");
window.onscroll = function() {
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
backToTop.style.display = "block";
} else {
backToTop.style.display = "none";
}
}