.nav-menu {
display: block;
position: relative;
list-style: none;
margin: 0;
padding: 0;
z-index: 15;
}
/* a top level navigation item in the mega menu */
.nav-item {
list-style: none;
display: inline-block;
padding: 0;
margin: 0;
}
/* first descendant link within a top level navigation item */
.nav-item > a {
position: relative;
display: inline-block;
padding: 0.5em 1em;
margin: 0 0 -1px 0;
border: 1px solid transparent;
}
/* focus/open states of first descendant link within a top level
navigation item */
.nav-item > a:focus,
.nav-item > a.open {
border: 1px solid #dedede;
}
/* open state of first descendant link within a top level
navigation item */
.nav-item > a.open {
background-color: #fff;
border-bottom: none;
z-index: 1;
}
/* sub-navigation panel */
.sub-nav {
position: absolute;
display: none;
top: 2.6em;
margin-top: -1px;
padding: 0.5em 1em;
border: 1px solid #dedede;
background-color: #fff;
}
/* sub-navigation panel open state */
.sub-nav.open {
display: block;
}
/* list of items within sub-navigation panel */
.sub-nav ul {
display: inline-block;
vertical-align: top;
margin: 0 1em 0 0;
padding: 0;
}
/* list item within sub-navigation panel */
.sub-nav li {
display: block;
list-style-type: none;
margin: 0;
padding: 0;
}
JavaScript
$("nav:first").accessibleMegaMenu({
/* prefix for generated unique id attributes, which are required
to indicate aria-owns, aria-controls and aria-labelledby */
uuidPrefix: "accessible-megamenu",
/* css class used to define the megamenu styling */
menuClass: "nav-menu",
/* css class for a top-level navigation item in the megamenu */
topNavItemClass: "nav-item",
/* css class for a megamenu panel */
panelClass: "sub-nav",
/* css class for a group of items within a megamenu panel */
panelGroupClass: "sub-nav-group",
/* css class for the hover state */
hoverClass: "hover",
/* css class for the focus state */
focusClass: "focus",
/* css class for the open state */
openClass: "open"
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.