Sidebar stay open on page change

2019-06-08 04:30发布

My sidebar collapses after I click on the sidebar. When I click on the sidebar the page opens but my sidebar collapses.

Can you please help me to avoid my sidebar collapsing after I click on the sidebar and my page opens ?

Can you please tell me what should I add to in my code below ?

Here is the URL of my website : www.beljike.be. You will find a sidebar with this specific issue.

Thank you very much.

<style type="text/css">
.widget_nav_menu > a { background-color: transparent; position: relative; }
.widget_nav_menu > a:after { font-family: 'ETmodules'; text-align: center; speak: none; font-weight: normal; font-variant: normal; text-transform: none; -webkit-font-smoothing: antialiased; position: absolute; }
.widget_nav_menu > a:after { font-size: 16px; content: '\4c'; top: 13px; right: 10px; }
.widget_nav_menu > a:after { content: '\4d'; }
.widget_nav_menu ul.sub-menu { display: none !important; visibility: hidden !important;  transition: all 1.5s ease-in-out;}
.widget_nav_menu .visible > ul.sub-menu { display: block !important; visibility: visible !important; }
</style>

<script type="text/javascript">
(function($) {

    function setup_collapsible_submenus() {
        var $menu = $('.widget_nav_menu'),
            top_level_link = '.widget_nav_menu > a';

        $menu.find('a').each(function() {
            $(this).off('click');

            if ( $(this).is(top_level_link) ) {
                $(this).attr('href', '#');
            }

            if ( ! $(this).siblings('.sub-menu').length ) {
                $(this).on('click', function(event) {
                    $(this).parents('.mobile_nav').trigger('click');
                });
            } else {
                $(this).on('click', function(event) {
                    event.preventDefault();
                    $(this).parent().toggleClass('visible');
                });
            }
        });
    }

    $(window).load(function() {
        setTimeout(function() {
            setup_collapsible_submenus();
        }, 700);
    });

})(jQuery);
</script>

0条回答
登录 后发表回答