I have a problem with hamburger menu. After i click on a menu. it cant closing automatically.
All of the menus is working, except the automatically function

Can somebody help in this?

	var responsiveMenu = function() {
        var menuType = 'desktop';

        $(window).on('load resize', function() {
            var currMenuType = 'desktop';

            if ( matchMedia( 'only screen and (max-width: 991px)' ).matches ) {
                currMenuType = 'mobile';

            if ( currMenuType !== menuType ) {
                menuType = currMenuType;

                if ( currMenuType === 'mobile' ) {
                    var $mobileMenu = $('#mainnav').attr('id', 'mainnav-mobi').hide();
                    var hasChildMenu = $('#mainnav-mobi').find('li:has(ul)');

                    hasChildMenu.children('a').after('<span class="btn-submenu"></span>');
                } else {
                   	var $desktopMenu = $('#mainnav-mobi').attr('id', 'mainnav').removeAttr('style');

        $('.btn-menu').on('click', function() {

        $(document).on('click', '#mainnav-mobi li .btn-submenu', function(e) {

Read more here: Hamburger menu automatically closing on wordpress


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: