How can i do for add ".active" class to anchor link (linke: /#same) on my menu links?

Comments

Idas created an issue. See original summary.

markhalliwell’s picture

Component: Theme Registry » Miscellaneous
Category: Feature request » Support request
Status: Active » Closed (works as designed)

They should already have the necessary classes, but a simple google search could answer your question if it's not to your liking.

Idas’s picture

Sorry but doesn't it feel that way. By default Bootstrap theme add .active class only on a link it's same of url page.
For example, in a one page site, all of the link in navbar have the class ".active"

Sure, I know how to make it work with a custom javascript.

Idas’s picture

Ok, redefine.
When we use the "scrollspy" this don't work because drupal writes the menu link with slash "/".
For example:
/#example
This is because we need to put first of hashtag anchor.

A quick solution is to work with Void Menu module. But you have 10 item limit.