Okay
  Public Ticket #1050983
Sidebar Menu in connection with section
Closed

Comments

  •  2
    tha-plug started the conversation

    We have a menu point that direct you to a section on the homesite. Unfortunately after clicking the menu remains open, which we believe is irritating for the client. Is there something we can do about it except of changing the menu type?

  • [deleted] replied

    Hi,

    Add this JavaScript code in Theme Options > Footer > JavaScript & Tracking Code > Footer JavaScript:

    <script>
    function closeSidebarMenu() {
    requestAnimationFrame( function() {

    publicVars.$body.removeClass( 'sidebar-is-opened' );

    if ( publicVars.$sidebarMenu.hasClass( 'sidebar-alignment-left' ) ) {
    publicVars.$body.removeClass( 'sidebar-is-opened-left' );
    }

    publicVars.$sidebarMenu.css( 'transform', 'translate3d(0px,0px,0px)' );

    }, publicVars.$wrapper);
    }

    jQuery( document ).ready( function( $ ) {
    $( '.sidebar-main-menu a[href*="#"]' ).on( 'click', closeSidebarMenu );
    } );
    </script>
    This should add that functionality to auto-close sidebar menu when clicking inline page elements.