Bootstrap手风琴不与本地来源合作

时间:2016-03-21 06:47:38

标签: twitter-bootstrap accordion

我正在使用Bootstrap 3.3.5并在本地托管它。在提供扩展时

<link href="../extensions/bootstrap-3.3.5/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="../extensions/bootstrap-3.3.5/dist/css/bootstrap-theme.min.css" rel="stylesheet">
<script src="bootstrap-3.3.5/dist/js/bootstrap.min.js"></script>

手风琴不起作用而是http://localhost:8085/header.php#collapseUsage,但是当我在线使用链接时

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

它工作正常。我已经检查过,文件的路径是正确的,CSS也可以。只有手风琴不起作用。我哪里出错了或者我错过了什么?感谢任何帮助。

2 个答案:

答案 0 :(得分:1)

检查名为location的<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>文件。它是如本例所示的实时链接吗?如果是,则将其下载到您的文件夹中,然后从本地路径调用它,就像调用css文件一样。

答案 1 :(得分:1)

您需要在引导程序文件之前包含jQuery文件。

<script src="jquery.min.js"></script>
<script src="bootstrap-3.3.5/dist/js/bootstrap.min.js"></script>
<link href="../extensions/bootstrap-3.3.5/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="../extensions/bootstrap-3.3.5/dist/css/bootstrap-theme.min.css" rel="stylesheet">