scroll up button, visible class

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

View file

@ -409,6 +409,10 @@ a.button:visited {
display: none; display: none;
} }
.visible-block {
display: block;
}
.spoiler-text { .spoiler-text {
display: inline; display: inline;
/* These are technically the same, but use both */ /* These are technically the same, but use both */

View file

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