mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-11-14 12:25:58 -06:00
9 lines
280 B
JavaScript
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";
|
|
}
|
|
}
|