Dinges Dinges - 1 year ago 64
jQuery Question

Responsive menu button doesn't automaticly close

I have some problems with my responsive menu on mobile. When I click on the menu-button it collapse a dropdown menu. But when I click on one of the links in the dropdown menu, it won't close by itself.

Can you please help me out?

Here's the link: http://www.air-technics.nl/warmtepomp

Answer Source
$('.navbar-nav > li').click(function(event) {
    var target = $(this).find('>a').prop('hash');
    $('html, body').animate({
        scrollTop: $(target).offset().top
    }, 500);
    $("#menu-icon").trigger("click"); // click on the hamburger icon
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download