From 4b77a8f09b019e3a2032b2f92ec210bc89002517 Mon Sep 17 00:00:00 2001 From: hugh5 Date: Mon, 11 Nov 2024 21:24:33 +1000 Subject: [PATCH] update navigation item active state check to use relative path --- js/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/script.js b/js/script.js index 96bfb0a..61dbb1d 100644 --- a/js/script.js +++ b/js/script.js @@ -87,7 +87,7 @@ function loadNav() { // Highlight the active nav item based on the current page $("nav > .menu-item").each(function () { const href = $(this).attr("href"); - if ("/" + page === href) { + if ("./" + page === href) { $(this).addClass("active"); } });