mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
Make buttons more consistent
Rename JumpUp button to top-of-page
This commit is contained in:
parent
0d10de923d
commit
b208b872d7
13 changed files with 143 additions and 102 deletions
|
@ -76,12 +76,13 @@ window.onscroll = function () {
|
|||
loadOnView();
|
||||
|
||||
// Jump to top button
|
||||
let topOfPage = document.querySelector('.top-of-page');
|
||||
if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) {
|
||||
document.querySelector('.jumpUp').classList = 'jumpUp jumpUp--show';
|
||||
topOfPage.classList.add('show');
|
||||
} else {
|
||||
document.querySelector('.jumpUp').classList = 'jumpUp';
|
||||
topOfPage.classList.remove('show');
|
||||
}
|
||||
document.querySelector('.jumpUp').onclick = function () {
|
||||
topOfPage.onclick = function () {
|
||||
document.body.scrollTop = 0;
|
||||
document.documentElement.scrollTop = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue