12 lines
268 B
JavaScript
12 lines
268 B
JavaScript
{0a3a0d150f316d646147fa17aacf4e78dcdc46a8 true 268 main.js 0xc001ec8fc0}
let span = document.querySelector(".up");
|
|
|
|
window.onscroll = function () {
|
|
|
|
this.scrollY >= 1000 ? span.classList.add("show") : span.classList.remove("show");
|
|
};
|
|
span.onclick = function () {
|
|
window.scrollTo({
|
|
top: 0,
|
|
behavior: "smooth",
|
|
});
|
|
}; |