openvk/Web/static/js/scroll.js

14 lines
334 B
JavaScript
Raw Permalink Normal View History

2020-06-07 19:04:43 +03:00
window.addEventListener("scroll", function(e) {
if(window.scrollY < 100) {
2020-06-07 19:04:43 +03:00
document.body.classList.toggle("scrolled", false);
} else {
document.body.classList.toggle("scrolled", true);
}
});
u(".toTop").on("click", function(e) {
window.scrollTo({
top: 0,
behavior: "smooth"
});
});