单击时,bootstrap切换按钮不起作用

时间:2014-04-09 07:54:22

标签: javascript jquery html css twitter-bootstrap

这是我的代码。在我错误的地方纠正我,因为我是新手。我是

切换按钮在响应中不起作用

请指导......

<!--<link href="css/style.css" rel="stylesheet">-->
<link href="css/style.css" rel="stylesheet">
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<script type="text/javascript" src="js/bootstrap.js"></script>
<!--<script type="text/javascript" src="js/bootstrap.min.js"></script>-->

<body>
    <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
                <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="#">Menu</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <nav class="navbar-collapse nav-collapse in" style="height: auto;">
            <ul class="nav nav-pills nav-justified sf-js-enabled" id="navigation">
                <li class="current"><a class="btn" href="index.html">Home</a></li>
                <li><a class="btn" href="our-advisors.html">Our Advisors</a></li>
                <li><a class="btn" href="destinations.html">Destinations</a></li>
                <li><a class="btn" href="special-deals.html">Special Deals</a></li>
                <li><a class="btn" href="gift-registery.html">Gift Registery</a></li>
                <li><a class="btn" href="philantrophy.html">Philantropy</a></li>
                <li><a class="btn" href="contact.html">Contact Us</a></li>
            </ul>
        </nav>
        </div><!-- /.container-fluid -->
    </nav>
</body>

2 个答案:

答案 0 :(得分:1)

这个jquery文件是jquery函数工作所必需的。缺少以下文件链接。

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

将以上行添加到您的脚本然后它将正常工作........

答案 1 :(得分:0)

您需要插入html&amp; head标签,还包括jQuery ......

<script src='http://code.jquery.com/jquery-latest.min.js'></script>

这应该是这样的:

<!DOCTYPE html>
<html>
  <head>
    <!-- all your includes and then jQuery -->
    <script src='http://code.jquery.com/jquery-latest.min.js'></script>
  </head>
  <body>
    <!-- Everything in your <body></body> tags
  </body>
</html>