Hi Goldilocks,
Nice effect, I haven’t seen that before.
I’ve taken a fairly long look and I can’t work out how to make it do what you want it to do. I suspect it’s z-index related.
The sub menu always needs to be above the menu bar (as the sub menu has the shadow on it), but the main menu bar needs to be above the sub menu for the shadow to display below it. I think it’s impossible using the current technique.
Regards,
Tom
Hi Tom,
Thanks for getting back to me. I was worried you might say it’s z-index related and therefore not possible!
I started out by researching methods for applying the greyed out effect via an additional div on hover before realising the shadow might just do it for me… I will go back to my research!
Many thanks
Becca
Quick update, I’m using this as the starting point.
But actually, I’m struggling with basic css now!
I’ve added an additional div, ‘wrapper’ in my header:
<div id="wrapper">
<?php
if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( array( 'theme_location' => 'primary' ) );
}
else {
wp_page_menu();
}
?></div>
Then changed the styles from the fiddle to:
.wrapper {
padding:0;
margin:0;
height:100%;
width:100%;
}
.wrapper {
-webkit-transition:all 300ms;
-moz-transition:all 300ms;
-ms-transition:all 300ms;
-o-transition:all 300ms;
transition:all 300ms;
}
.wrapper:hover {
background:rgba(0,0,0,.3);
}
.wrapper:hover .mega-menu-link {
background:#ddd;
}
.mega-menu-wrap {
padding:6px;
}
.mega-menu-link {
margin-bottom:6px;
padding:12px;
border-radius:3px;
background:#eee;
}
.mega-menu-link:hover {
background:#fff!important;
}
But what I can’t figure out is which div in the mega menu is equivalent to the ‘expose’ div in the fiddle. I know this is really basic but I’m stumped!