mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 20:23:18 -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";
|
|
}
|
|
}
|