Tweak the scroll button

This commit is contained in:
Tom Hubrecht 2021-08-20 12:48:39 +02:00
parent b4ffd2ee36
commit d210fc88c4
4 changed files with 8 additions and 2 deletions

View file

@ -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');