Bootstrap Collapse
2016-07-19 17:14
507 查看
Flexible plugin that utilizes a handful of classes for easy toggle behavior.
Plugin dependency
Collapse requires the transitions plugin to be included in your version of Bootstrap.
Example
Click the buttons below to show and hide another element via class changes:
.collapse hides content
.collapsing is applied during transitions
.collapse.in show content
Use a link with the href attribute,or a button with the data-target attribute.In both cases,the data-toggle="collapse" is required
<a href="#collapseExample" class="btn btn-primary" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="collapseExample">
Link with href
</a>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Button with data-target
</button>Accordion
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a href="#collapseOne" data-toggle="collapse" data-parent="#accordion" aria-controls="collapseOne" aria-expanded="true">
Collapse Group #1
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpane1" aria-labelledby="headingOne">
<div class="panel-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title">
<a href="#collapseTwo" role="button" data-toggle="collapse" data-parent="#accordion" aria-expanded="false" aria-controls="collapseTwo">
Collapse Group #2
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
Plugin dependency
Collapse requires the transitions plugin to be included in your version of Bootstrap.
Example
Click the buttons below to show and hide another element via class changes:
.collapse hides content
.collapsing is applied during transitions
.collapse.in show content
Use a link with the href attribute,or a button with the data-target attribute.In both cases,the data-toggle="collapse" is required
<a href="#collapseExample" class="btn btn-primary" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="collapseExample">
Link with href
</a>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Button with data-target
</button>Accordion
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a href="#collapseOne" data-toggle="collapse" data-parent="#accordion" aria-controls="collapseOne" aria-expanded="true">
Collapse Group #1
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpane1" aria-labelledby="headingOne">
<div class="panel-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingTwo">
<h4 class="panel-title">
<a href="#collapseTwo" role="button" data-toggle="collapse" data-parent="#accordion" aria-expanded="false" aria-controls="collapseTwo">
Collapse Group #2
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
相关文章推荐
- bootstrap tab切换如何让鼠标移动自动切换内容
- Bootstrap~大叔封装的弹层
- bootstrap, boosting, bagging 几种方法的联系
- Bootstrap基本使用
- 推荐一款基于bootstrap的漂亮的前端模板——inspinia_admin
- easyUI+bootstrap工作站,主要学习tabs方法
- Bootstrap Nav
- 表单验证 BootstrapValidator
- 使用 bootstrapTable 绘表格的时候,如何给每行绑定不同的data-guid 的扩展字段呢?
- JS组件Bootstrap实现弹出框和提示框效果代码
- Bootstrap表单布局
- Bootstrap的less
- Bootstrap的JavaScript插件
- Bootstrap的使用
- Bootstrap把玩0:安装
- bootstrap教程(一)———bootstrap标题(一)
- 关于bootstrap-datetimepicker 插件的配置参数详解
- 基于bootstrap metronic-responsive-admin-dashboard-template 开发管理后台
- Bootstrap3 多个模态对话框无法显示的问题
- bootstrap教程(一)———bootstrap标题(一)