0

I have an anchor link in my main menu that links to an anchor on the homepage. Problem is that when I am on the home page the anchor link is showing as active even though the anchor is halfway down the page.

Anchor Link Permanantly Active on Home page

Is it possible to apply a class to this that just displays it like the un active menu items or have i done something wrong with the anchor link?

I have tried multiple variations of .menu-item-106 a {} & .nav-menu .current_page_item > a, etc. but I can't get it right!

I'd appreciate if anyone can anyone help or point me in the right direction?

4

3 回答 3

1

You can try add this jquery code for disable anchor hightlight, in the configuration menu, add extra class "anchor" in menus with achors.

jQuery(document).ready(function($) {

    var current =  $(".menu-main-menu").find(".anchor");
    $(current).removeClass("current-menu-item current_page_item");


});
于 2016-05-30T12:59:57.647 回答
0

.menu-item-106 a:link, .menu-item-106 a :visited, .menu-item-106 a :active {....}
.menu-item-106 a :hover{...}

maybe?

于 2013-05-29T09:18:57.657 回答
0

The following two css made the active page remove it and check

current-menu-item 
current_page_item
于 2013-05-29T09:20:48.450 回答