Navbar折叠按钮在bootstrap 3中不起作用

时间:2014-03-25 17:40:33

标签: javascript jquery html css twitter-bootstrap

我正试图让导航栏上的折叠按钮工作,但我似乎无法做到。我已经检查过数据目标指向.navbar-collapse,据我所知,我的css和javascript都在那里。无法弄清楚我做错了什么。

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script type="text/javasript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script type="text/javasript" src="js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="style.css" type="text/css" />
    <title></title>
</head>
<body>
    <div class="container">
        <nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="navbar-header">
                <a class="navbar-brand" href="#"><img src="assets/images/title.png" class="img-responsive" /></a>
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <div class="navbar-header">
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav navbar-right">
                        <li class="active"><a href="#">Home</a></li>
                        <li><a href="#about">About</a></li>
                        <li><a href="#contact">Contact</a></li>
                    </ul>
                </div>
            </div>
        </nav>
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <img src="assets/images/hero-banner.jpg" class="img-responsive" />
                </div>
            </div>
        </div>
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <img src="assets/images/mountains-small.jpg" class="img-responsive" />
                    <p id="hometext">text goes here</p>
                </div>
            </div>
        </div>
        <div class="container">
            <div class="container" id="footer">
                <div class="row"> 
                    <div class="col-xs-12">
                        <p class="footerheading">Contact Us</p>
                        <p class="copyright">&copy; 2014 <a href="#">company</a></p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

0 个答案:

没有答案