单击bootstrap 3

时间:2015-06-30 08:39:37

标签: php jquery twitter-bootstrap sidebar

我有这个代码。当我点击侧栏中的链接时,它会进入相关链接并关闭菜单。我想打开链接以及我点击的菜单。 我正在设计一个70多页的网站,该网站使用多层边栏菜单和图像地图进行导航,并在导航栏中添加面包屑以跟踪您所处的位置。

我希望能够: 1.打开子菜单面板并显示可用的菜单选项列表; 2.突出显示当前页面的菜单树选项;和 3.将当前页面的相应链接添加到面包屑pat。

但是,当我对侧边栏进行更改时(例如,添加或删除菜单选项,更改子菜单项的分组或顺序等),我必须完全相同的更改时间70!经过1或2次修改后,我宁愿不做任何更改!

<div id="sidebar" class="navbar-collapse collapse">
<!-- BEGIN Navlist -->
<ul class="nav nav-list">
    <li>
        <div class="admin_logo">
            <a href="index.php" class="viewSelect"><img src="img/logo.png" alt="Inksand Logo"></a>
        </div>
    </li>
    <li>
        <a href="index.php">
            <i class="fa fa-dashboard"></i>
            <span>Dashboard</span>
        </a>
    </li>
    <li>
        <a href="#" class="dropdown-toggle">
            <i class="fa fa-file-text"></i>
            <span>Catalog</span>
            <b class="arrow fa fa-angle-right"></b>
        </a>
        <!-- BEGIN Submenu -->
        <ul class="submenu">          
            <li>
        <a href="#" class="dropdown-toggle">              
                    <span>Categories</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
                    <li><a href="add-category-master.php">Add Categories</a></li>
                    <li><a href="category-master.php">Manage Categories</a></li>
                </ul>
            </li>               
            <li>
        <a href="#" class="dropdown-toggle">              
                    <span>Vendors</span>
                    <b class="arrow fa fa-angle-right "></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
                    <li><a href="add-vendor-master.php">Add Vendors</a></li>
                    <li><a href="vendor-master.php">Manage Vendors</a></li>
                </ul>
            </li>
            <li>
        <a href="#" class="dropdown-toggle">              
                    <span>Products</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
                    <li><a href="add-product-master.php">Add Products</a></li>
                    <li><a href="product-master.php">Manage Products</a></li>
                </ul>
            </li>
        </ul>
        <!-- END Submenu -->
    </li>
    <li>
        <a href="#" class="dropdown-toggle">
            <i class="fa   fa-map-marker"></i>
            <span>Localization</span>
            <b class="arrow fa fa-angle-right"></b>
        </a>
        <!-- BEGIN Submenu -->
        <ul class="submenu">
            <li>
        <a href="#" class="dropdown-toggle">              
                    <span>Countries</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
                    <li><a href="add-country-master.php">Add Countries</a></li>
                    <li><a href="country-master.php">Manage Countries</a></li>
                </ul>
            </li>
            <li>
        <a href="#" class="dropdown-toggle">              
                    <span>States</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
                    <li><a href="add-state-master.php">Add States</a></li>
                    <li><a href="state-master.php">Manage States</a></li>
                </ul>
            </li>
            <li>
        <a href="#" class="dropdown-toggle">              
                    <span>Cities</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
                    <li><a href="add-city-master.php">Add Cities</a></li>
                    <li><a href="city-master.php">Manage Cities</a></li>
                </ul>
            </li>
            <li>
        <a href="#" class="dropdown-toggle">              
                    <span>Areas</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
                    <li><a href="add-area-master.php">Add Areas</a></li>
                    <li><a href="area-master.php">Manage Areas</a></li>
                </ul>
            </li>
    <!-- 
    <li>
        <a href="#" class="dropdown-toggle">              
                    <span>Misc</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                 BEGIN Submenu 
                <ul class="submenu">
                    <li><a href="order-status-master.php">Order Status</a></li>
        <li><a href="payment-master.php">Payment</a> 
                </ul>
            </li>
    -->
        </ul>
        <!-- END Submenu -->
    </li>
    <li>
        <a href="#" class="dropdown-toggle">
            <i class="fa  fa-bar-chart-o"></i>
            <span>Sales</span>
            <b class="arrow fa fa-angle-right"></b>
        </a>
        <!-- BEGIN Submenu -->
        <ul class="submenu">
    <li><a href="order-master.php">Order</a></li>
            <li><a href="courier-master.php">Shipment</a></li>
            <li><a href="return-master.php">Return</a></li>
            <li><a href="payment-master.php">Payment</a></li>
        </ul>
        <!-- END Submenu -->
    </li>
    <li>
        <a href="#" class="dropdown-toggle">
            <i class="glyphicon glyphicon-list"></i>
            <span>Stock</span>
            <b class="arrow fa fa-angle-right"></b>
        </a>
        <!-- BEGIN Submenu -->
        <ul class="submenu">
            <li><a href="add-stock-master.php">Add Stock</a></li>
            <li><a href="stock-master.php">Manage Stock</a></li>
    <li><a href="garbage-stock-master.php">Manage Garbage</a></li>
        </ul>
        <!-- END Submenu -->
    </li>
    <li>
        <a href="#" class="dropdown-toggle">
            <i class="fa   fa-money"></i>
            <span>Tax</span>
            <b class="arrow fa fa-angle-right"></b>
        </a>
        <!-- BEGIN Submenu -->
        <ul class="submenu">
            <li><a href=add-tax-master.php>Add Tax</a></li>
            <li><a href=tax-master.php>Manage Tax</a></li>
        </ul>
        <!-- END Submenu -->
    </li>
    <li>
        <a href="#" class="dropdown-toggle">
            <i class="fa  fa-user"></i>
            <span>Customers</span>
            <b class="arrow fa fa-angle-right"></b>
        </a>
        <!-- BEGIN Submenu -->
        <ul class="submenu">
            <li><a href="customer-master.php">Manage Customers</a></li>
        </ul>
        <!-- END Submenu -->
    </li>
    <li>
        <a href="#" class="dropdown-toggle">
            <i class="fa   fa-cog"></i>
            <span>Tools</span>
            <b class="arrow fa fa-angle-right"></b>
        </a>
        <!-- BEGIN Submenu -->
        <ul class="submenu">
    <li><a href="javascript:void(0)">Banner</a></li>
            <li><a href="backup-master.php">Backup</a></li>
            <li><a href="javascript:void(0)">Setting</a></li>
        </ul>
        <!-- END Submenu -->
    </li>
    <li>
        <a href="#" class="dropdown-toggle">
            <i class="fa fa-file-text-o"></i>
            <span>Report</span>
            <b class="arrow fa fa-angle-right"></b>
        </a>
        <!-- BEGIN Submenu -->
        <ul class="submenu">
    <li>
                <a href="#" class="dropdown-toggle">              
                    <span>Sales</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
                    <li><a href="order-report.php">Order</a></li>
                    <li><a href="tax-report.php">Tax</a></li>
        <li><a href="shipping-report.php">Shipping</a></li>
        <li><a href="return-report.php">Return</a></li>
                </ul>
            </li>
    <li>
                <a href="#" class="dropdown-toggle">              
                    <span>Products</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
        <li><a href="product-report.php">Viewed</a></li>
                    <li><a href="#">Purchased</a></li>
                </ul>
            </li>
    <li>
                <a href="#" class="dropdown-toggle">              
                    <span>Vendors</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
        <li><a href="vendor-report.php">Vendor</a></li>
                </ul>
            </li>
    <li>
                <a href="#" class="dropdown-toggle">              
                    <span>Customers</span>
                    <b class="arrow fa fa-angle-right"></b>
                </a>
                <!-- BEGIN Submenu -->
                <ul class="submenu">
        <li><a href="customer-order-report.php">Order</a></li>
                    <li><a href="cart-report.php">Cart</a></li>
        <li><a href="wishlist-report.php">Wishlist</a></li>
                </ul>
            </li>
        </ul>
        <!-- END Submenu -->
    </li>
</ul>
<!-- END Navlist -->
<!-- BEGIN Sidebar Collapse Button -->
<div id="sidebar-collapse" class="visible-lg">
    <i class="fa fa-angle-double-left"></i>
</div>
<!-- END Sidebar Collapse Button -->

1 个答案:

答案 0 :(得分:0)

您需要将active课程添加到您要打开的项目中。

例如:

            <ul class="submenu">
                <li class="active"><a href="add-category-master.php">Add Categories</a></li>
                <li><a href="category-master.php">Manage Categories</a></li>
            </ul>

顶部打开类别菜单并突出显示&#34;添加类别&#34;项目