wp-rdnyc/assets/js/_hamburger-helper.js

13 lines
457 B
JavaScript
Raw Normal View History

2021-07-26 13:07:57 -04:00
const togglerBtn = document.getElementById("top-navbar-grid-toggle-button");
const navbarContent = document.getElementById("top-navbar-grid-main-menu-outer");
navbarContent.addEventListener("show.bs.collapse", () => {
console.log("opening navbar content");
togglerBtn.classList.toggle("is-active");
});
navbarContent.addEventListener("hide.bs.collapse", () => {
console.log("closing navbar content");
togglerBtn.classList.toggle("is-active");
});