scroll up button, visible class

This commit is contained in:
ReznoRMichael 2021-02-16 18:55:33 +01:00
commit 578824f00a
2 changed files with 11 additions and 6 deletions

View file

@ -10,19 +10,20 @@ function ShowElement() {
}
function HideElement() {
}
function DetectPageScroll() {
/* Maximum number of pixels that can be scrolled by the user */
let scrollTotal = ROOT.scrollHeight - ROOT.clientHeight;
let scrollUpButton = document.querySelector(".scroll-up-button");
if ((ROOT.scrollTop / scrollTotal ) > 0.80) {
//show button
} else {
//hide button
}
if ((ROOT.scrollTop / scrollTotal) > 0.80) {
/* Show button */
} else {
/* Hide button */
}
}
document.addEventListener("scroll", DetectPageScroll);