Provides an interactive menu with optional sub-menus. Implements the WAI-ARIA menu design pattern.
header area of the page. Note: This step should already be done for most themes.
<nav role="navigation" id="wb-sm" data-trgt="mb-pnl" class="wb-menu visible-md visible-lg" typeof="SiteNavigationElement">
<div class="container nvbar">
<h2>Topics menu</h2>
<div class="row">
<ul class="list-inline menu">
<li><a href="#">Section 1</a></li>
<li><a href="#">Section 2</a></li>
<li><a href="#">Section 3</a></li>
</ul>
</div>
</div>
</nav>
<nav role="navigation" id="wb-sm" data-trgt="mb-pnl" class="wb-menu visible-md visible-lg" typeof="SiteNavigationElement">
<div class="container nvbar">
<h2>Menu des sujets</h2>
<div class="row">
<ul class="list-inline menu">
<li><a href="#">Section 1</a></li>
<li><a href="#">Section 2</a></li>
<li><a href="#">Section 3</a></li>
</ul>
</div>
</div>
</nav>
ul element with list items (li) containing the desired links.class="container" element and its descendants. Sub-menus are achieved by nesting <ul class="sm list-unstyled" id="lore" role="menu"> in each li element of the menu bar. The following is an example of a full menu:
<div class="pnl-strt container visible-md visible-lg nvbar">
<h2>Topics menu</h2>
<div class="row">
<ul class="list-inline menu" role="menubar">
<li><a href="#lore" class="item">Section 1</a>
<ul class="sm list-unstyled" id="lore" role="menu">
<li><a href="#">Item 1.1</a></li>
...
</ul>
</li>
<li><a href="#lor" class="item">Section 2</a>
<ul class="sm list-unstyled" id="lor" role="menu" >
<li><a href="#">Item 2.1</a></li>
...
<li class="slflnk"><a href="#">Section 2 - More</a></li>
</ul>
</li>
<li><a href="#lorm" class="item">Section 3</a>
<ul class="sm list-unstyled" id="lorm" role="menu" >
<li>
<details>
<summary>Section 3.1</summary>
<ul role="menu">
<li><a href="#">Item 3.1.1</a></li>
...
</ul>
</details>
</li>
...
</ul>
</li>
</ul>
</div>
</div>
<div class="pnl-strt container visible-md visible-lg nvbar">
<h2>Menu des sujets</h2>
<div class="row">
<ul class="list-inline menu" role="menubar">
<li><a href="#lore" class="item">Section 1</a>
<ul class="sm list-unstyled" id="lore" role="menu">
<li><a href="#">Article 1.1</a></li>
...
</ul>
</li>
<li><a href="#lor" class="item">Section 2</a>
<ul class="sm list-unstyled" id="lor" role="menu" >
<li><a href="#">Article 2.1</a></li>
...
<li class="slflnk"><a href="#">Section 2 - Autre</a></li>
</ul>
</li>
<li><a href="#lorm" class="item">Section 3</a>
<ul class="sm list-unstyled" id="lorm" role="menu" >
<li>
<details>
<summary>Section 3.1</summary>
<ul role="menu">
<li><a href="#">Article 3.1.1</a></li>
...
</ul>
</details>
</li>
...
</ul>
</li>
</ul>
</div>
</div>
details elements.<ul class="sm list-unstyled" id="lorm" role="menu" >
<li>
<details>
<summary>Section 3.1</summary>
<ul role="menu">
<li><a href="#">Item 3.1.1</a></li>
...
</ul>
</details>
</li>
...
</ul>
data-ajax-replace="[url]" to the element with class="wb-menu", with [url] being the URL of the full menu to AJAX in.
<nav role="navigation" id="wb-sm" data-ajax-replace="ajax/menu-include-en.html" data-trgt="mb-pnl" class="wb-menu visible-md visible-lg" typeof="SiteNavigationElement">
data-trgt with the id of the target element for the mobile panel (in most cases this should not change).| Option | Description | How to configure | Values |
|---|---|---|---|
data-ajax-replace |
Used to AJAX in a full menu. | Add data-ajax-replace="[url]" to the element with class="wb-menu", with [url] being the URL of the full menu to AJAX in. |
|
data-trgt |
Used to identify the target for the mobile panel. | Add data-trgt="mb-pnl" to the element with class="wb-menu". The value of data-trgt must match the id of the target element for the mobile panel. |
|
| Event | Trigger | What it does |
|---|---|---|
wb-init.wb-menu |
Triggered manually (e.g., $( ".wb-menu" ).trigger( "wb-init.wb-menu" );). |
Used to manually initialize the menu plugin. Note: The menu plugin will be initialized automatically unless the menu markup is added after the page has already loaded. |
wb-ready.wb-menu (v4.0.5+) |
Triggered automatically after a menu has initialized. | Used to identify which menu has initialized (target of the event).
|
wb-ready.wb (v4.0.5+) |
Triggered automatically when WET has finished loading and executing. | Used to identify when all WET plugins and polyfills have finished loading and executing.
|