Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add back to top button (#16979)
* docs: add back to top button * fix: spacing errors of previous commit * docs: update css of scrollup button * docs: add css comments for color * fix: spacing issues of last commit * docs: set the scroll btn to work without js * docs: update previous code * docs: update previous code
- Loading branch information
1 parent
ad9dd6a
commit e39f28d
Showing
5 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(function () { | ||
const scrollUpBtn = document.getElementById("scroll-up-btn"); | ||
|
||
if(window.innerWidth < 1400) { | ||
window.addEventListener("scroll", function () { | ||
if(document.body.scrollTop > 500 || document.documentElement.scrollTop > 500) { | ||
scrollUpBtn.style.display = "flex"; | ||
} else { | ||
scrollUpBtn.style.display = "none"; | ||
} | ||
}); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,3 +207,7 @@ ul { | |
margin: 1cm; | ||
} | ||
} | ||
|
||
#scroll-up-btn { | ||
display: none; | ||
} |