I've been trying to create a button that animates when the menu opens and closes. To do this I created a simple function to execute API.open();
and API.close();
when the button is clicked. Code:
var API = $("#primary-menu").data( "mmenu" ),
menuOpen = 0;
$("#menu-button").click(function() {
if(menuOpen === 0){
API.open();
menuOpen = 1;
}
else{
API.close();
menuOpen = 0;
}
});
Now the problem is the button doesn't animate when the menu closes by clicking on the content area
$(".mm-opening #mm-0").click(function(){
console.log("Click Successful");
$("#menu-button").removeClass("close");
});
Using the console.log method and dev tools, I found out the the click is not at all registered when I click in the content area, so I cannot animate the icon.
Here's the demo: http://bwdmedia.in/camelport/vendor-panel/ Can someone explain the reason for this? Or another way to achieve the same result.