Need help for manually setting active
for header menu
#67
-
This is a partial continuation of this. Long story short, I have to manually set
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The active state is controlled by JavaScript now, not templates, there maybe useless code in template. |
Beta Was this translation helpful? Give feedback.
-
I think I found the cause, I remember you trimed the trailing slash from your site, right? However the menu links weren't. So that will cause the JavaScript could not find the right element. The easest way to solve this is appending the slash to location.pathname or location.href if there isn't in JavaScript. |
Beta Was this translation helpful? Give feedback.
I think I found the cause, I remember you trimed the trailing slash from your site, right? However the menu links weren't. So that will cause the JavaScript could not find the right element.
The easest way to solve this is appending the slash to location.pathname or location.href if there isn't in JavaScript.