<nav id="my-panel">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about/">About us</a>
<ul>
<li><a href="/about/history/">History</a></li>
<li><a href="/about/team/">The team</a></li>
<li><a href="/about/address/">Our address</a></li>
</ul>
</li>
<li><a href="/contact/">Contact</a></li>
</ul>
</nav>
<button id="toggler" class="hamburger" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
$(document).ready(function() {
$("#my-menu").mmenu();
var API = $("#my-menu").data("mmenu");
$("#toggler").click(function() {
API.open();
});
});
выбивает ошибку
Uncaught TypeError: Cannot read property 'open' of undefined
at HTMLButtonElement. (scripts.min.js:1)
at HTMLButtonElement.dispatch (jquery.min.js:3)
at HTMLButtonElement.q.handle (jquery.min.js:3)
Памагите что делать ?