]> skyeroc.xyz Git - flatmark/commitdiff
fix menu-highlighting
authorelektrischerwalfisch <mail@elektrischerwalfisch.de>
Fri, 11 Apr 2025 21:33:37 +0000 (23:33 +0200)
committerelektrischerwalfisch <mail@elektrischerwalfisch.de>
Fri, 11 Apr 2025 21:33:37 +0000 (23:33 +0200)
theme/js/presets.js

index c8c7047b80a2e717a2e83154d2e2e9828a6fcdb2..d445c946db9eea7120f4207148f829ec57e70dd5 100644 (file)
@@ -41,7 +41,7 @@ document.addEventListener("DOMContentLoaded", function() {
 // HEADER: highlight active page in main menu
     const currentUrl = window.location.href;
     const currentPath = window.location.pathname;
-    const menuLinks = document.querySelectorAll('header > ul a');
+    const menuLinks = document.querySelectorAll('header nav ul a');
     menuLinks.forEach((link) => {
         // Check if the href matches the current URL or pathname
         if (link.href === currentUrl || link.pathname === currentPath) {