Accessible MegaMenu
Resize the browser below 768px width for mobile view.
<!-- Root Element -->
<nav id="__amegmen_root">
<!-- Button (on mobile) to toggle Megamenu on mobile device -->
<button class="__amegmen--toggle-cta">
Menu
</button>
<!-- Off-Canvas which slides on mobile device -->
<div class="__amegmen--canvas">
<!-- Nav Header containing a Button to close the Megamenu -->
<header>
<!-- Button (on mobile) to close the Megamenu -->
<button class="__amegmen--close-cta">
Close
</button>
</header>
<!-- Main section containing Megamenu navigation -->
<section class="__amegmen--main">
<!-- Level 0 UL/LI -->
<ul>
<li>
<!-- Level 0 anchor -->
<a href="#">Risus</a>
<!-- Level 0 Megamenu panel -->
<section class="__amegmen--panel">
<!-- Container for Level 0 anchor's landing page url -->
<div class="__amegmen--landing">
<!-- Button (on mobile) to go main menu (level 0) -->
<button class="__amegmen--main-cta">Main</button>
<!-- Level 0 anchor's landing page url -->
<a href="#Tempor sit maecenas">Landing page: Tempor sit maecenas</a>
</div>
<!-- Level 1 navigation -->
<nav>
<!-- Level 1 navigation column 0 -->
<div class="__amegmen--col">
<!-- Level 1 UL/LI -->
<ul>
<li>
<!-- Level 1 anchor -->
<a href="#">Amet nunc dis Sem</a>
<!-- Level 1 Megamenu panel -->
<section class="__amegmen--panel">
<!-- Container for Level 1 anchor's landing page url -->
<div class="__amegmen--landing">
<!-- Button (on mobile) to go previous menu (level 1) -->
<button class="__amegmen--back-cta">Back</button>
<!-- Level 1 anchor's landing page url -->
<a href="#">Landing page: Tempor consectetur gravida Malesuada penatibus Purus</a>
</div>
<!-- Level 2 navigation -->
<nav>
<!-- Level 2 navigation column -->
<div class="__amegmen--col">
<!-- Level 2 UL/LI/A -->
<ul>
<li><a href="#">Vivamus maecenas ex</a></li>
<li><a href="#">Amet vulputate malesuada</a></li>
<li><a href="#">Nulla maximus malesuada Magnis metus Etiam</a></li>
<li><a href="#">Eget velit elit</a></li>
<li><a href="#">Nullam molestie vestibulum In amet In</a></li>
<li><a href="#">Neque congue elit Ut</a></li>
<li><a href="#">Nisl et lorem Nullam</a></li>
<li><a href="#">Nullam fermentum malesuada Ut ac Quam</a></li>
<li><a href="#">Erat quam a In mattis</a></li>
</ul>
</div>
</nav>
</section>
</li>
. . .
</ul>
</div>
<!-- Level 1 navigation column 1 -->
<div class="__amegmen--col">
<!-- Level 1 UL/LI -->
<ul>
<li>
<!-- Level 1 anchor -->
<a href="#">Et elementum gravida Porttitor</a>
<!-- Level 1 Megamenu panel -->
<section class="__amegmen--panel">
<!-- Container for Level 1 anchor's landing page url -->
<div class="__amegmen--landing">
<!-- Button (on mobile) to go previous menu (level 1) -->
<button class="__amegmen--back-cta">Back</button>
<!-- Level 1 anchor's landing page url -->
<a href="#">Landing page: Magnis congue vehicula Aliquam turpis</a>
</div>
<!-- Level 2 navigation -->
<nav>
<!-- Level 2 navigation column -->
<div class="__amegmen--col">
<!-- Level 2 UL/LI/A -->
<ul>
<li><a href="#">Pulvinar consectetur elementum Phasellus dolor</a></li>
<li><a href="#">Nullam vivamus turpis Ut</a></li>
<li><a href="#">Tempus et proin</a></li>
<li><a href="#">Maximus non nunc Porta in</a></li>
. . .
</ul>
</div>
</nav>
</section>
</li>
</ul>
</div>
<!-- Repeat Level 1 navigation columns -->
</nav>
</section>
</li>
<!-- Repeat Level 0 LI -->
</ul>
</section>
</div>
</nav>
<script> src="path/to/amegmen.min.js"></script>
<script>
var amegmen_instance = AMegMen.Root.getInstance();
var amegmen_options = {};
amegmen_instance.init("#__amegmen_root", amegmen_options);
/* You can destroy it as well */
amegmen_instance.destroy("#__amegmen_root");
</script>
<link href="path/to/amegmen.min.css" rel="stylesheet" />