17 lines
662 B
TypeScript
17 lines
662 B
TypeScript
document.addEventListener("DOMContentLoaded", function () {
|
|
const stickyNav = document.querySelector("div.sticky-navigation");
|
|
if (stickyNav === null) {
|
|
return;
|
|
}
|
|
|
|
const button = document.querySelector(".sticky-navigation .btn") as HTMLButtonElement;
|
|
const navWrapper = document.querySelectorAll(".sticky-navigation-wrapper ");
|
|
button.addEventListener("click", () => {
|
|
navWrapper.forEach((element: Element) => {
|
|
element.classList.toggle("show");
|
|
});
|
|
document.querySelectorAll(".sticky-navigation .btn svg").forEach(icon => {
|
|
icon.classList.toggle("d-none");
|
|
});
|
|
});
|
|
});
|