Skip to content

Need help for manually setting active for header menu #67

Closed Answered by razonyang
TetraTheta asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@TetraTheta
Comment options

@TetraTheta
Comment options

@razonyang
Comment options

Answer selected by TetraTheta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants