Tweak the scroll button
This commit is contained in:
parent
b4ffd2ee36
commit
d210fc88c4
4 changed files with 8 additions and 2 deletions
|
@ -10590,6 +10590,7 @@ body {
|
|||
position: fixed;
|
||||
bottom: 2em;
|
||||
right: 2em;
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=main.css.map */
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -51,3 +51,4 @@ body
|
|||
position: fixed
|
||||
bottom: 2em
|
||||
right: 2em
|
||||
z-index: 30
|
||||
|
|
|
@ -106,8 +106,12 @@
|
|||
|
||||
// Scroll to top button
|
||||
$up_btn = document.getElementById('scroll-button');
|
||||
if (document.documentElement.scrollTop >= 100) {
|
||||
$up_btn.classList.remove('is-hidden');
|
||||
}
|
||||
|
||||
window.onscroll = () => {
|
||||
if (document.documentElement.scrollTop >= 30) {
|
||||
if (document.documentElement.scrollTop >= 100) {
|
||||
$up_btn.classList.remove('is-hidden');
|
||||
} else {
|
||||
$up_btn.classList.add('is-hidden');
|
||||
|
|
Loading…
Reference in a new issue