<nav id="ddmenu">
<div class="menu-icon"></div>
<ul>
<li>...</li>
... ...
<li>...</li>
</ul>
</nav>
Open ddmenu.js from the download package and configure the options as needed:
var ddmenuOptions=
{
menuId: "ddmenu",
linkIdToMenuHtml: null,
open: "onmouseover", //or "onclick"
delay: 90,
speed: 400,
keysNav: true,
singleOpen: false,
};
var ddmenu = new Ddmenu(ddmenuOptions);
Animation speed (in milliseconds) of the dropdown sub-menu.
Note: The transition speed for the background color of top-level menu items (<li>) is defined in the ddmenu.css:
#ddmenu li { transition:background-color 0.2s; }
Using TAB or arrow keys to navigate through the mega menu links.
Set it to false will disable this accessibility.
The download package contains the source code and all five templates.
ddmenu initializes when the page loads. If the menu markup is added later, initialize ddmenu using one of two methods:
var ddmenu = new Ddmenu(ddmenuOptions);
Then, add this line at the appropriate place in your code—such as inside a fetch callback—when you want to initialize the menu.
ddmenu.init();