From: elektrischerwalfisch Date: Fri, 11 Apr 2025 21:33:37 +0000 (+0200) Subject: fix menu-highlighting X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=6f8744dda1bf19dfd15695f86c46b137014ea631;p=flatmark fix menu-highlighting --- diff --git a/theme/js/presets.js b/theme/js/presets.js index c8c7047..d445c94 100644 --- a/theme/js/presets.js +++ b/theme/js/presets.js @@ -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) {