导航菜单无法在响应式视图中使用

时间:2014-06-28 06:51:17

标签: twitter-bootstrap

我是bootstrap的新手,我想制作一个导航菜单使用bootstrap 3.每件事都很好,但问题是我的导航菜单无法在响应式视图中工作。我已经包含了所有javascript文件和css文件,并且还编写了类似于bootstrap网页中显示的代码。请帮助。

这是我的html结构:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>Theme-1</title>
    <meta name="description" content="">
    <meta name="author" content="">

    <meta name="viewport" content="width=device-width; initial-scale=1.0">
    <link href="css/bootstrap.css" rel="stylesheet" />
    <script src="js/bootstrap.js"></script>
    <script src="js/jquery-1.10.2.js"></script>
    </head>

    <body>
    <!-- HEADER SECTION START-->
    <header>
        <section class="header_top">
            <div class="container">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-6" style="border: 1px solid #CCCCCC;">
                        <ul class="list-inline">
                            <li><span class="glyphicon glyphicon-earphone"> </span> (123)-456-7890</li>
                            <li><span class="glyphicon glyphicon-envelope"> </span> info@promiti.com</li>
                        </ul>
                    </div>
                    <div class="col-lg-6 col-md-6 col-sm-6 text-right" style="border: 1px solid #CCCCCC;">
                        <ul class="list-inline">
                            <li><span class="glyphicon glyphicon-leaf"> </span></li>
                            <li><span class="glyphicon glyphicon-fire"> </span></li>
                            <li><span class="glyphicon glyphicon-globe"> </span></li>
                            <li><span class="glyphicon glyphicon-cog"> </span></li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
        <section class="header_fixed">
            <!-- <div class="container"> -->
                <!-- <div class="row"> -->
                    <!-- <div class="col-lg-2 col-md-2 col-sm-2" style="border: 1px solid #CCCCCC;">
                        <a class="">LOGO</a>
                    </div> -->
                    <!-- <div class="col-lg-10 col-md-10 col-sm-10" style="border: 1px solid #CCCCCC;"> -->
                        <div class="navbar navbar-default" role="navigation">
                            <div class="container">
                                <div class="navbar-header">
                                    <button type="button" class="navbar-toggle" 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="#">LOGO</a>
                                </div>
                                <div class="navbar-collapse collapse">
                                    <ul class="nav navbar-nav navbar-right">
                                        <li class="active"><a href="#">Home</a></li>
                                        <li><a href="#">Pages</a></li>
                                        <li><a href="#">Contact</a></li>
                                        <li><a href="#">About</a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    <!-- </div> -->
                <!-- </div> -->
            <!-- </div> -->
        </section>
    </header>
    <!-- HEADER SECTION END-->

    <!-- BANNER SECTION START-->
    <section class="banner">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12" style="border: 1px solid #CCCCCC;">
                    Image_silder_section
                </div>
            </div>
        </div>
    </section>
    <!-- BANNER SECTION END-->

    <!-- CONTENT PORTION 1 START -->
    <section class="content_section_1">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12" style="border: 1px solid #CCCCCC;">
                    Content_Section_1
                </div>
            </div>
        </div>
    </section>
    <!-- CONTENT PORTION 1 END -->

    <!-- CONTENT PORTION 2 START -->
    <section class="content_section_2">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12" style="border: 1px solid #CCCCCC;">
                    Content_Section_2
                </div>
            </div>
        </div>
    </section>
    <!-- CONTENT PORTION 2 END -->

    <!-- CONTENT PORTION 3 START -->
    <section class="content_section_3">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12" style="border: 1px solid #CCCCCC;">
                    Content_section_3
                </div>
            </div>
        </div>
    </section>
    <!-- CONTENT PORTION 3 END -->

    <!-- CONTENT PORTION 4 START -->
    <section class="content_section_4">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12" style="border: 1px solid #CCCCCC;">
                    Content_section_4
                </div>
            </div>
        </div>
    </section>
    <!-- CONTENT PORTION 4 END -->

    <!-- CONTENT PORTION 5 START -->
    <section class="content_section_5">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12" style="border: 1px solid #CCCCCC;">
                    Content_section_5
                </div>
            </div>
        </div>
    </section>
    <!-- CONTENT PORTION 5 END -->

    <!-- CONTENT PORTION 6 START -->
    <section class="content_section_6">
        <div class="container">
            <div class="row" style="border: 1px solid #CCCCCC;">
                <div class="col-lg-3 col-md-3 col-sm-3" style="border: 1px solid #CCCCCC;">
                    Content_section_6_column_1
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="border: 1px solid #CCCCCC;">
                    Content_section_6_column_2
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="border: 1px solid #CCCCCC;">
                    Content_section_6_column_3
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="border: 1px solid #CCCCCC;">
                    Content_section_6_column_4
                </div>
            </div>
        </div>
    </section>
    <!-- CONTENT PORTION 6 END -->

    <!-- CONTENT PORTION 7 START -->
    <section class="content_section_7">
        <div class="container">
            <div class="row">
                <div class="col-lg-3 col-md-3 col-sm-3" style="border: 1px solid #CCCCCC;">
                    Content_section_7_column_1
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="border: 1px solid #CCCCCC;">
                    Content_section_7_column_2
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="border: 1px solid #CCCCCC;">
                    Content_section_7_column_3
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3" style="border: 1px solid #CCCCCC;">
                    Content_section_8_column_4
                </div>
            </div>
        </div>
    </section>
    <!-- CONTENT PORTION 7 END -->

    <!-- CONTENT PORTION 8 START -->
    <section class="footer">
        <div class="container">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 text-center" style="border: 1px solid #CCCCCC;">
                    &copy; 2014 Theme-1. All Rights Reserved
                </div>
            </div>
        </div>
    </section>
    <!-- CONTENT PORTION 8 END -->

    </body>

1 个答案:

答案 0 :(得分:1)

<script src="js/bootstrap.js"></script>
<script src="js/jquery-1.10.2.js"></script>

首先尝试调用jquery然后调用bootstrap:

<script src="js/jquery-1.10.2.js"></script>    
<script src="js/bootstrap.js"></script>