Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
happylinze authored Jun 3, 2024
1 parent 14fdc04 commit 742134e
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ layout: default
border-radius: 5px;
}

/* #navbar.hidden {
#navbar.hidden {
top: -80px;
} */
}

.content {
margin-top: 60px;
Expand Down Expand Up @@ -146,30 +146,30 @@ layout: default
} */
</style>

<button id="back-to-top"> </button>
<button id="back-to-top"> Top </button>

<script>
// document.addEventListener('scroll', function() {
// const navbar = document.getElementById('navbar');
// if (window.scrollY > 50) {
// navbar.classList.add('hidden');
// } else {
// navbar.classList.remove('hidden');
// }
// });

// document.addEventListener('DOMContentLoaded', function() {
// const navbar = document.getElementById('navbar');
// navbar.addEventListener('mouseenter', function() {
// navbar.classList.remove('hidden');
// });

// // navbar.addEventListener('mouseleave', function() {
// // if (window.scrollY > 50) {
// // navbar.classList.add('hidden');
// // }
// // });
// });
document.addEventListener('scroll', function() {
const navbar = document.getElementById('navbar');
if (window.scrollY > 50) {
navbar.classList.add('hidden');
} else {
navbar.classList.remove('hidden');
}
});

document.addEventListener('DOMContentLoaded', function() {
const navbar = document.getElementById('navbar');
navbar.addEventListener('mouseenter', function() {
navbar.classList.remove('hidden');
});

navbar.addEventListener('mouseleave', function() {
if (window.scrollY > 50) {
navbar.classList.add('hidden');
}
});
});

var backToTopButton = document.getElementById("back-to-top");
window.addEventListener("scroll", function() {
Expand Down

0 comments on commit 742134e

Please sign in to comment.