Skip to content

Commit

Permalink
js change
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaythakur8764 committed Nov 18, 2024
1 parent 406bd87 commit 90dc972
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/layout/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ document.addEventListener('DOMContentLoaded', () => {
function addActiveClass() {
if(window.location.hash){
var currentUrl = window.location.pathname + window.location.hash.replace(/\/+$/, '');
console.log(currentUrl);
// console.log(currentUrl);
}
else{
var currentUrl = window.location.pathname.replace(/\/+$/, '') + window.location.hash;
Expand All @@ -25,7 +25,7 @@ function addActiveClass() {

menuItems.forEach(item => {
var menuItemUrl = item.getAttribute('href');
console.log(menuItemUrl);
// console.log(menuItemUrl);


if (currentUrl === menuItemUrl || window.location.hash === menuItemUrl) {
Expand Down

0 comments on commit 90dc972

Please sign in to comment.