用于移动设备的Bootstrap导航切换

时间:2015-06-20 23:00:05

标签: javascript php jquery twitter-bootstrap web

我使用Bootstrap模板启动了我的网站。我添加了一个navlogic,并在自己的CSS中对徽标进行了一些调整。现在,当我在移动设备上试用我的网站时,它会调整大小,但是当我点击按钮时没有任何反应。我在StackOverflow上找到一些答案,有人写信给控制台,所以我做了。它说

  

"无法加载资源:服务器响应状态为404   (未找到)"

同时包含http://localhost/onair/js/jquery.jshttp://localhost/onair/js/bootstrap.min.js。我非常困惑,因为当我启动原始模板时,一切正常。任何人都可以帮我这个吗?

<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<title>Scheduler</title>

<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">

<!-- Custom CSS -->
<link href="css/logo-nav.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

    <!-- Navigation -->
    <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="#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="#"> <img src="res/logo.png" alt="">
                </a>
            </div>
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="collapse">
                <ul class="nav navbar-nav">
                    <li><a href="?site=scheduler">Zeitplan</a></li>
                    <li><a href="?site=profile">Profil</a></li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>

    <!-- Page Content -->
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
               <?php require_once 'navlogic.php'; ?>
            </div>
        </div>
    </div>
    <!-- /.container -->

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

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

</body>

</html>

1 个答案:

答案 0 :(得分:1)

响应式导航栏需要collapse plugin,我相信这是问题所在。