jonnykates
10/5/2017 - 2:47 PM

Side menu javascript

Some useful JS when working with the side menu

// Add a close button to the active side menu
$('<a class="navClose">Close menu</a>').prependTo('#menuMain');

// Click handler for closing the menu
$('a.menuMainAlt').click(function (event) {
    $('body').addClass('menu-active');
    // e.preventDefault();
    event.stopPropagation();

    $('body.menu-active, .navClose').click(function (event) {
        $("a.menuMainAlt,.menuMain").removeClass("active");
        $('.noclick').remove();
        event.stopPropagation();
    });

    $('.menuMain').click(function (event) {
        event.stopPropagation();
    });
});