Okay
  Public Ticket #1702236
Change sidebar menu behavior
Closed

Comments

  • guilhermecid started the conversation

    Hi,

    it is difficult to explain in words so we made a video.

    can you please watch this 40 seconds video:

    https://share.vidyard.com/watch/LDgjUMoUNzuUyfBimen69C?


    Thank you!


  • [deleted] replied

    Hi,

    I understand the point, thanks for your clear explanation. Yes that is possible, I have created a code for you to support that, here is the code you can save in Theme Options > Footer > JavaScript & Tracking Code:

    <script>
    jQuery( document ).ready( function () {
        setTimeout( function () {
            var $subs = jQuery( '.sidebar-menu .menu-item-has-children' );
            $subs.unbind();
            var lastClicked = null;
            $subs.each( function ( i, el ) {
                var $li = jQuery( el ),
                    $sub = $li.find( '> ul' ),
                    $link = $li.find( '> a' );
                $sub.hide().css( 'height', '' ).find( '.opacity-hidden' ).removeClass( 'opacity-hidden' );
                $link.on( 'click', function ( ev ) {
                    ev.preventDefault();
                    $sub.slideToggle( 300 );
                    console.log( $sub[ 0 ] );
                } );
            } );
        }, 100 );
    } );
    </script>

    Here is how it works:

    https://d.pr/v/axX2DE

    I hope you will like it.