我需要手風琴窗格的幫助。 它有兩個功能: - 點擊添加按鈕 時動態添加窗格 - 單擊窗格中的「X」圖標使用bootstrap3動態添加或刪除手風琴窗格
守則JSFiddle 代碼時,請取出窗格: -
的Html
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<span class="glyphicon glyphicon-remove-circle pull-right "></span>
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
Bill Info 1
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
This is a form field for adding Bill Info 1
</div>
</div>
</div>
<div id="button-add">
<button type="button" class="btn btn-primary">Add Bill</button>
</div>
</div>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
CSS
#button-add{
margin-top:10px;
margin-left: 10px;
}
我會喜歡在Bootstrap3的基礎上做到這一點。如果有鏈接,請將它們發佈!
謝謝!
上的jsfiddle –