Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi,

    Parent menu items of the selected item will have this class:

    .mega-current_page_ancestor

    So you would need to apply your styling to that (if I understand correctly!)

    Regards,
    Tom

    Thread Starter W2014

    (@w2014)

    Hallo, thanks for the reply, it worked for the ancestor with:

    li.mega-current-menu-ancestor

    but i want also the submenu to be highlighted, when it shows up. how can i highlight also the submenu? i mean, i want it to stay highlighted, when i slide the submenu again. i tried with li.li.mega-current-menu a and it did not worked…

    hier is my menu:

    <div id="menu1">
      <div id="mega-menu-wrap-primary-2" class="mega-menu-wrap"><input type="checkbox" id="mega-menu-toggle-primary-2" class="mega-menu-toggle">
    							<label for="mega-menu-toggle-primary-2"></label><ul id="mega-menu-primary-2" class="mega-menu mega-menu-horizontal mega-no-js" data-event="hover" data-effect="slide"><li class='mega-menu-item mega-menu-item-type-custom mega-menu-item-object-custom mega-menu-item-home mega-menu-item-10 mega-align-bottom-left mega-menu-flyout' id='mega-menu-item-10'><a href="http://www.xxxxxx.com/web/">Home</a></li>
    <li class='mega-menu-item mega-menu-item-type-custom mega-menu-item-object-custom mega-current-menu-ancestor mega-current-menu-parent mega-menu-item-has-children mega-menu-item-23 mega-align-bottom-left mega-menu-flyout' id='mega-menu-item-23'><a href="#">About us</a>
    <ul class="mega-sub-menu">
    	<li class='mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-current-menu-item mega-page_item mega-page-item-16 mega-current_page_item mega-menu-item-26' id='mega-menu-item-26'><a href="http://www.xxxxxx.com/web/?page_id=16">Team</a></li>
    	<li class='mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-25' id='mega-menu-item-25'><a href="http://www.xxxxxx.com/web/?page_id=19">Menu2</a></li>
    	<li class='mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-24' id='mega-menu-item-24'><a href="http://www.xxxxxx.com/web/?page_id=21">Menu3</a></li>
    </ul>
    </li>
    <li class='mega-menu-item mega-menu-item-type-custom mega-menu-item-object-custom mega-menu-item-has-children mega-menu-item-45 mega-align-bottom-left mega-menu-flyout' id='mega-menu-item-45'><a href="#">Menu4</a>
    <ul class="mega-sub-menu">
    	<li class='mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-53' id='mega-menu-item-53'><a href="http://www.xxxxxx.com/web/?page_id=27">Submenu1</a></li>
    	<li class='mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-52' id='mega-menu-item-52'><a href="http://www.xxxxxx.com/web/?page_id=29">Submenu2</a></li>
    	<li class='mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-51' id='mega-menu-item-51'><a href="http://www.xxxxxx.com/web/?page_id=31">Submenu3</a></li>
    
    </ul>
    </li>
    <li class='mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-54 mega-align-bottom-left mega-menu-flyout' id='mega-menu-item-54'><a href="http://www.xxxxxx.com/web/?page_id=43">Contact</a></li>
    </ul></div></div>
    Thread Starter W2014

    (@w2014)

    i solved it the following way, just for info:

    #{$wrap} #{$menu} {
        /** Custom styles should be added below this line **/
    
       li.mega-menu-item:first-child a{
            @include border-radius($container_border_radius_top_left, 0, 0, 0);
    
        }
       li.mega-menu-item:last-child a {
            @include border-radius(0, $container_border_radius_top_right, 0, 0);
    
        }
    
        ul.mega-sub-menu li.mega-menu-item:first-child {
            @include border-radius(0, 0, 0, 0);
        }
        ul.mega-sub-menu li.mega-menu-item:first-child a {
            @include border-radius(0, 0, 0, 0);
        }
        ul.mega-sub-menu li.mega-menu-item:last-child {
            @include border-radius(0, 0, 10px, 10px);
        }
    
        ul.mega-sub-menu li.mega-menu-item:last-child  a {
            @include border-radius(0, 0, 10px, 10px);
    
        }
    
      li.mega-current-menu-ancestor, li.mega-current-menu-ancestor a:hover, ul.mega-sub-menu li.mega-current-menu-item a{
            background: red!important;
    
      }
      li.mega-current-menu-item:first-child a {
            @include border-radius($container_border_radius_top_left, 0, 0, 0);
            background: red;
      }
      li.mega-current-menu-item:last-child a {
            @include border-radius(0, $container_border_radius_top_right, 0, 0);
            background: red;
      }
    }
    
    #{$wrap} {
        clear: both;
    }

    actually, this is something that every menu should have:

    – current menu highlighted, including the submenu. it is nothing special.
    – also the rounded corners, at the top ends of the menu and at the bottom of the submenu.

    !tom, you could think about including this option in the admin area…

    thanks anyway, a nice plugin…
    if someone has a better or optimized idea…

    Plugin Author megamenu

    (@megamenu)

    Hi,

    Looks good!

    I will add some more options to the theme editor soon, but I want to be careful not to add so many that it becomes confusing. If I’m not careful the theme editor could end up with 100’s of options 🙂

    Regards,
    Tom

    Have a simple menu with nu submenu and want to have the current menu-item highlighted only…any clues?

    Thx for a great plugin!

    🙂

    Oh I found out from above:

    li.mega-current-menu-item a{
    background: red!important;
    }}

    Thx!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Current submenu parent page item highlighted’ is closed to new replies.