Boostrap Nav-Bar切换按钮在某些页面上不起作用

时间:2017-01-09 15:45:39

标签: html css asp.net

我在许多ASPX页面上使用下面的导航栏。

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">

        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="Home.aspx">Home</a>
            </div>

            <div class="w3-container">
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav navbar-right">
                        <li class="w3-dropdown-hover">
                            <a href="News.aspx">News</a>
                            <div class="w3-dropdown-content w3-white w3-card-4">
                                <a href="News.aspx">Latest News</a>
                                <a href="NewsArchive.aspx">News Archive</a>
                            </div>
                        </li>
                        <li class="w3-dropdown-hover">
                            <a href="Sports.aspx">Sports</a>
                            <div class="w3-dropdown-content w3-white w3-card-4">
                                <a href="#">GAA</a>
                                <a href="#">Camogie</a>
                                <a href="#">Ladies Football</a>
                                <a href="#">Richmond Soccer</a>
                                <a href="#">Fishing</a>
                                <a href="#">Restocking Association</a>
                                <a href="#">Walking Club</a>
                                <a href="#">Gun Club</a>
                            </div>
                        </li>
                        <li class="w3-dropdown-hover">
                            <a href="ViewEvents.aspx">Groups</a>
                            <div class="w3-dropdown-content w3-white w3-card-4">
                                <a href="#">Scouts</a>
                                <a href="#">ICA</a>
                                <a href="#">Red Cross</a>
                                <a href="#">CFR</a>
                                <a href="#">Vincent de Paul</a>
                            </div>
                        </li>
                        <li><a href="Church.aspx">Church of St. James</a></li>
                        <li><a href="#">Ballinora N.S.</a></li>
                        <li><a href="LocalProducts.aspx">Local Business</a></li>
                        <li><a href="Gardening.aspx">Gardening</a></li>
                        <li class="w3-dropdown-hover">
                            <a href="CommunityAssociation.aspx">Comm. Association</a>
                            <div class="w3-dropdown-content w3-white w3-card-4">
                                <a href="#">Environment</a>
                                <a href="#">Social Inclusion</a>
                                <a href="#">Infrastructure</a>
                                <a href="#">Recreation</a>
                                <a href="#">Culture & Heritage</a>
                                <a href="#">Roads & Road Safety</a>
                                <a href="#">Safety & Security</a>
                            </div>
                        </li>
                        <li><a href="Admin.aspx">Admin</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <!-- /.container -->
    </nav>

当我最小化所有页面上的屏幕时,导航栏会折叠并且显示如下:

scrn1

然后,当我点击右上角的按钮时,在某些页面上,菜单显示如下:

scrn2

但是,这仅适用于我的两个页面,Sports.aspx和ViewEvents.aspx

在其他页面上,菜单正在折叠,但是当我点击右上角按钮时,没有任何反应。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

找到它,我忘了在以下部分添加以下代码:

        <!-- jQuery -->
<script src="js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>