1
1
Fork 0
mirror of https://github.com/openvk/openvk synced 2025-01-14 20:12:59 +03:00
openvk/Web/static/js/scroll.js

14 lines
343 B
JavaScript
Raw Normal View History

2020-06-07 19:04:43 +03:00
window.addEventListener("scroll", function(e) {
if(document.body.scrollTop < 100) {
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"
});
});