单击href时保持侧边栏菜单打开

时间:2019-11-16 01:48:53

标签: accordion

您能帮我解决这个问题吗?

我想在单击href时使边栏保持打开状态。现在,当我单击一个选项时,网络将刷新,菜单会折叠。

我当时想也许是一种更好的制作我制作的侧边栏手风琴的方法。

<div class="row" id="body-row">
    <!-- Sidebar -->
    <div id="sidebar-container" class="sidebar-expanded d-none d-md-block"><!-- d-* hiddens the Sidebar in smaller devices. Its itens can be kept on the Navbar 'Menu' -->
        <!-- Bootstrap List Group -->
        <ul class="list-group">
            <!-- Separator with title -->
            <a href="index.php" class="bg-dark list-group-item list-group-item-action">
                <div class="d-flex w-100 justify-content-start align-items-center">
                    <span class="fas fa-tachometer-alt mr-3"></span>
                    <span class="menu-collapsed">Dashboard</span>
                </div>
            </a>
            <!-- /END Separator -->
            <!-- Separator with title -->
            <li class="list-group-item sidebar-separator-title text-muted d-flex align-items-center menu-collapsed">                
            </li>            
            <!-- Menu with submenu -->
            <a href="#submenu1" data-toggle="collapse" aria-expanded="false" class="bg-dark list-group-item list-group-item-action flex-column align-items-start">
                <div class="d-flex w-100 justify-content-start align-items-center">
                    <span class="fas fa-server mr-3"></span> 
                    <span class="menu-collapsed">Usuarios Especiales</span>
                    <span class="submenu-icon ml-auto"></span>
                </div>
            </a>
            <!-- Submenu content -->
            <div id='submenu1' class="collapse sidebar-submenu" data-parent="#sidebar-container">
                <a href="altacuenta.html" class="list-group-item list-group-item-action bg-dark1 text-white">
                    <i class="fas fa-angle-right"></i>
                    <span class="menu-collapsed">Alta usuario</span>
                </a>
                <a href="#" class="list-group-item list-group-item-action bg-dark1 text-white">
                    <i class="fas fa-angle-right"></i>
                    <span class="menu-collapsed">Buscar usuario</span>
                </a>
                <a href="#" class="list-group-item list-group-item-action bg-dark1 text-white">
                    <i class="fas fa-angle-right"></i>
                    <span class="menu-collapsed">Tables</span>
                </a>
            </div>
            <a href="#submenu2" data-toggle="collapse" aria-expanded="false" class="bg-dark list-group-item list-group-item-action flex-column align-items-start">
                <div class="d-flex w-100 justify-content-start align-items-center">
                    <span class="fas fa-key mr-3"></span>
                    <span class="menu-collapsed">Locker</span>
                    <span class="submenu-icon ml-auto"></span>
                </div>
            </a>            
            <!-- Submenu content -->
            <div id='submenu2' class="collapse sidebar-submenu" data-parent="#sidebar-container">
                <a href="#" class="list-group-item list-group-item-action bg-dark1 text-white">
                    <i class="fas fa-angle-right"></i>
                    <span class="menu-collapsed">Settings</span>
                </a>
                <a href="#" class="list-group-item list-group-item-action bg-dark1 text-white">
                    <i class="fas fa-angle-right"></i>
                    <span class="menu-collapsed">Password</span>
                </a>
            </div>
        </ul><!-- List Group END-->
    </div><!-- sidebar-container END -->

致谢。

0 个答案:

没有答案