Skip to content

Commit a77cf3c

Browse files
authored
Update navbar.html
Signed-off-by: Vivek Vishal <vishalvivek488@gmail.com>
1 parent fe422d8 commit a77cf3c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

layouts/partials/navbar.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,16 @@
164164
dropdown.addEventListener("click", function (event) {
165165
event.stopPropagation();
166166

167+
// hide any other active dropdowns
168+
const allActiveDropdowns = document.querySelectorAll(".nav-link.current");
169+
allActiveDropdowns.forEach((otherDropdown) => {
170+
if (otherDropdown !== dropdown) {
171+
otherDropdown.classList.remove("current");
172+
otherDropdown.nextElementSibling.classList.remove("show");
173+
otherDropdown.nextElementSibling.style.visibility = "hidden";
174+
}
175+
});
176+
167177
if (dropdown.classList.contains("current")) {
168178
dropdown.classList.remove("current");
169179
dropdownMenu.classList.remove("show");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy