Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #505390

    I have the main menu with two levels of sub menu items.
    Main Menu Item
    – Sub Menu level 1
    – Sub Menu level 2

    When sub menu item 1 or sub menu item 2 is clicked, I need the main menu items to be highlighted as if active (change to active colour). Do you know how I can achieve this?

    Many Thanks
    Regards
    Colin

    #505573

    Hi waveseven!

    When you click on a link in the menu it is going to load a new page and when the new page is loaded there should already be a highlight for the current page (and also it’s children).

    Cheers!
    Elliott

    #505581

    Hi Elliot

    Yes when you click a sub menu link it opens a new page. I want to be able to click on the sub menu link and when the page opens the parent links of that page are the active page link colour.

    Many Thanks
    Regards
    Colin

    #505863

    Hi!

    Add the “.active-parent-item” selector in your css modifications:

    #header .current_page_item a, #header .main_menu a:hover, .active-parent-item {
        background-color: #de1a17 !important;
        -webkit-border-top-left-radius: 5px;
        -webkit-border-top-right-radius: 5px;
        -moz-border-radius-topleft: 5px;
        -moz-border-radius-topright: 5px;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
        color: white !important;
        background-color: #BF0F13;
        background-image: -webkit-gradient(linear, left top, left bottom, from(#ED161C), to(#BF0F13));
        background-image: -webkit-linear-gradient(top, #ED161C, #BF0F13);
        background-image: -moz-linear-gradient(top, #ED161C, #BF0F13);
        background-image: -ms-linear-gradient(top, #ED161C, #BF0F13);
        background-image: -o-linear-gradient(top, #ED161C, #BF0F13);
        background-image: linear-gradient(to bottom, #ED161C, #BF0F13);
    }

    Regards,
    Ismael

    #505889

    Hi Ismael

    That is fantastic, thank you so much. You guys are brilliant !!

    Many Thanks
    Regards
    Colin

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Highlight Main Menu Item when Sub Menu level 2 is clicked?’ is closed to new replies.