moye moye - 4 years ago 80
CSS Question

I would like the function where the mobile menu (Responsive Navigation) slides away or closes after a selection has been made

I would like the function where the mobile menu (Responsive Navigation) slides away or closes after a selection has been made

$("#btn_open_menu").click(function(e) {

e.preventDefault();

$("#header").toggleClass("active");

if ($("#header").hasClass('active')) {
$("#header .menu_closed").css('display', 'block');
} else {
$("#header .menu_closed").css('display', 'none');
}

return false;
});

//closed menu in responsive
$("#menu_closed").click(function(e) {

e.preventDefault();

$("#header").removeClass('active')
$("#header .menu_closed").css('display', 'none');

return false;
});

Answer Source

try

$(".link_menu").on("click",function(){
    $("#header").removeClass("active");
});
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download