单击导航栏时,Bootstrap菜单不会打开

时间:2015-04-04 12:23:53

标签: javascript php html css twitter-bootstrap

我点击&#34>点击"无法打开Bootstrap菜单在它上面。意思是我看不到任何物品。但是当我按下"向下键"从键盘立即打开。 当我从xaamp服务器运行它时尤其如此。但是当我在没有任何服务器的浏览器中直接打开时,我可以看到点击菜单。

我的代码的快照如下所示。 我在下面添加了css和javascripts

 <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
        <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
        <link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="css/isotope.css" media="screen" /> 
        <link rel="stylesheet" href="js/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="css/bootstrap.css">
        <link rel="stylesheet" href="css/bootstrap-theme.css">
        <link rel="stylesheet" href="css/style.css">


<div class="navbar navbar-fixed-top" role="navigation" data-0="line-height:100px; height:100px; background-color:rgba(0,0,0,0.3);" data-300="line-height:60px; height:60px; background-color:rgba(0,0,0,1);">
             <div class="container-fluid">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="fa fa-bars color-white"></span>
                    </button>
                    <h1><a class="navbar-brand" href="index.php" data-0="line-height:90px;" data-300="line-height:50px;">           CityMart
                    </a></h1>
                </div>
                <div class="collapse navbar-collapse collapse">
                    <ul class="nav nav-pills">

                        <ul class="nav navbar-nav" data-0="margin-top:20px;" data-300="margin-top:5px;">
                        <li class="active"><a href="admin_index.php">Home</a></li>
                        <!--<li><a href="#section-about">Abut</a></li>
                        <li><a href="#section-works">Portfolio</a></li>-->
                        <li><a href="#section-works">categories</a></li>
                         <li role="presentation" class="dropdown">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="admin_index.php" role="button" aria-expanded="true">
                              Dropdown <strong class="caret"></strong>
                            </a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="admin_category_insert.php">ADD Category</a></li>
                                <li><a href="admin_category_insert.php">ADD Subcategory</a></li>
                                <li><a href="mall_registration.php">Mall Registration</a></li>
                                <li><a href="shop_in_mall.php">ADD Shops In Mall </a></li>
                            </ul>
                        </li>


                          </li> 
                    </ul>   

                </ul>

                </div><!--/.navbar-collapse -->
            </div>
        </div>

1 个答案:

答案 0 :(得分:0)

尝试使用bootstrap 3.3.4(最新版本)

<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.2.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/bootstrap/3.3.4/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/bootstrap/3.3.4/css/bootstrap.min.css">