2015-06-20 46 views
1

我使用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

我們看不到localhost文件,它們是本地的。你能展示一些真實的代碼嗎? – depperm

+0

這兩個鏈接都是來自引導的腳本。 – marcmaann

+0

我添加了我的代碼 – marcmaann

回答

1

響應式導航欄需要collapse plugin,我相信這是問題所在。

+0

我在代碼中鏈接了JQuery腳本以及JavaScript腳本。這些實際上是來自控制檯的無法找到的兩個鏈接。我採用了與模板完全相同的代碼,只做了一些調整。 – marcmaann

+0

您正在使用移動設備測試本地服務器中的Web嗎? localhost在您的移動設備和服務器中不同,因此引用js的url不正確,您可以使用相對路徑。 – josedefreitasc

+0

我實際上並未使用手機,只是放大瀏覽器。 – marcmaann