scroll up button, visible class
This commit is contained in:
parent
3acf94933e
commit
578824f00a
2 changed files with 11 additions and 6 deletions
|
|
@ -409,6 +409,10 @@ a.button:visited {
|
|||
display: none;
|
||||
}
|
||||
|
||||
.visible-block {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.spoiler-text {
|
||||
display: inline;
|
||||
/* These are technically the same, but use both */
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
Loading…
Reference in a new issue