jsfiddle中的bootstrap accordian示例

时间:2016-08-26 22:48:31

标签: twitter-bootstrap-3 jsfiddle

我正在尝试重新创建bootstrap accordion example

为什么这个JSFiddle不工作?

https://jsfiddle.net/43Tesseracts/dqzdL73p/5/

从示例中复制/粘贴HTML,并提供bootstrap.min.js和css。

示例说它使用transition.js,但这包含在已编译的min.js

1 个答案:

答案 0 :(得分:1)

enter image description here

这就是为什么它不能在jsfiddle

中工作的原因

相同的代码在其他地方工作。下面是示例

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Collapsible List Group</h2>
  <div class="panel-group">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h4 class="panel-title">
          <a data-toggle="collapse" href="#collapse1">Collapsible list group</a>
        </h4>
      </div>
      <div id="collapse1" class="panel-collapse collapse">
        <ul class="list-group">
          <li class="list-group-item">One</li>
          <li class="list-group-item">Two</li>
          <li class="list-group-item">Three</li>
        </ul>
        <div class="panel-footer">Footer</div>
      </div>
<div class="panel-heading">
        <h4 class="panel-title">
          <a data-toggle="collapse" href="#collapse2">Collapsible list group</a>
        </h4>
      </div>
<div id="collapse2" class="panel-collapse collapse">
        <ul class="list-group">
          <li class="list-group-item">One</li>
          <li class="list-group-item">Two</li>
          <li class="list-group-item">Three</li>
        </ul>
        <div class="panel-footer">Footer</div>
      </div>
    </div>
  </div>

</div>

</body>
</html>