Tweak the scroll button
This commit is contained in:
parent
b4ffd2ee36
commit
d210fc88c4
4 changed files with 8 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue