• Resolved Gerald

    (@gerital)


    My theme uses ajax to load content, that’s because I need the audio player go on reproducing. With this theme mobile menu doesn’t get closed when I click on a menu.

    I tried calling this method to close my right menu, but without success:

    $(".mobmenu-right-bt").click();

    Would it be enough to add this method like this (so it get’s called every time I click):

    $(".mobmenu-panel .menu-item").click(function() {
        ...
    });

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rui Guerreiro

    (@takanakui)

    @gerital I had a look and it seems something from the theme is capturing the events of the click and because of that the mobile menu script isn’t being executed.

    Can you reach the theme support so they can explain where that is done so that is possible to call this function to close the menu

    mobmenuClosePanel( 'mobmenu-right-panel' );

    Thread Starter Gerald

    (@gerital)

    Thanks for your help. I tried to call mobmenuClosePanel( ‘mobmenu-right-panel’ ); from my theme, but it failed with Uncaught ReferenceError: mobmenuClosePanel is not defined.

    But it worked out using directly the code from the named function:

    $(".mobmenu-panel .menu-item").click(function() {
    	//mobmenuClosePanel( 'mobmenu-right-panel' );
            $( '.mobmenu-right-panel' ).toggleClass( 'show-panel' );
            $( 'html' ).removeClass( 'show-mobmenu-filter-panel' );
            $( 'body' ).removeClass( 'show-nav-right' );
            $( 'body' ).removeClass( 'show-nav-left' );
            $( 'html' ).removeClass( 'mob-menu-no-scroll' );
    });
    Plugin Author Rui Guerreiro

    (@takanakui)

    @gerital

    It seems it isn’t working because the function it’s in a different file and loaded at a different time.
    Copying the code of the function will be the best solution and as you already tested it and it’s working.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Close menu on ajax theme’ is closed to new replies.