我试着使用twitter bootstrap网站上提供的例子来实现collapse。当我试用这段代码时,点击链接来折叠内容并没有什么效果。下面是我的代码:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test</title>
<link href="../css/bootstrap.css" rel="stylesheet">
<link href="../css/bootstrap-responsive.css" rel="stylesheet">
<script type="text/javascript" src="../js/bootstrap.js"></script>
</head>
<body>
<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
Collapsible Group Item #1
</a>
</div>
<div id="collapseOne" class="accordion-body collapse in">
<div class="accordion-inner">
Anim pariatur cliche...
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
Collapsible Group Item #2
</a>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div class="accordion-inner">
Anim pariatur cliche...
</div>
</div>
</div>
</div>
</body>
</html>
1条答案
按热度按时间6ie5vjzr1#
Bootstrap的JavaScript库依赖于jQuery。
请在此处查看备注-http://getbootstrap.com/2.3.2/getting-started.html#file-structure
请注意,所有JavaScript插件都要求包含jQuery。
或者现代版的~ http://getbootstrap.com/getting-started/#jquery-required
需要jQuery
请注意,所有JavaScript插件都要求包含jQuery,如启动模板. Consult our
bower.json
中所示,以查看支持哪些版本的jQuery。