web/public/res/script/navbar.js

17 lines
457 B
JavaScript
Raw Normal View History

2024-04-09 15:29:00 +02:00
function toggleMenu() {
const navLinks = document.querySelector(".top-bar nav ul");
navLinks.classList.toggle("show");
}
function hideMenu() {
const navLinks = document.querySelector(".top-bar nav ul");
navLinks.classList.remove("show");
}
window.addEventListener("resize", function() {
const navLinks = document.querySelector(".top-bar nav ul");
if (window.innerWidth > 768) {
navLinks.classList.remove("show");
}
});