bootstrap的折叠组件1
官网的例子:
http://v3.bootcss.com/javascript/#collapse
<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 role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" 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 class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #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>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingThree">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
Collapsible Group Item #3
</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
<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>
官网的效果:
自己根据这个折叠组件写的:--看折叠组件部分的代码就好了。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>导航测试</title>
<link rel="stylesheet" type="text/css" href="bootstrap/bootstrap.min.css">
<style type="text/css">
.navbar-inverse .navbar-header .active{
background-color: #31708f;
}
.navbar-inverse .navbar-brand {
color: #fff;
cursor: pointer;
padding: 15px 25px;
font-size: 14px;
}
.navbar-inverse {
background-color: #337ab7;
border-color: #337ab7;
}
.navbar-inverse .navbar-nav>li>a {
color: #fff;
} .navbar-inverse .navbar-nav>.active>a, .navbar-inverse .navbar-nav>.active>a:focus, .navbar-inverse .navbar-nav>.active>a:hover{
color: #fff;
background-color: #31708f;
}
.navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a:focus, .navbar-inverse .navbar-nav>.open>a:hover{
color: #fff;
background-color: #337ab7;
}
input#sw{
font-style: italic;
color: #aaa;
}
.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form{
border-color: #337ab7;
}
@media (max-width: 767px){
.navbar-inverse .navbar-nav .open .dropdown-menu .divider{
background-color: rgba(0,0,0,.075);
}
} /* 产品分类 */
ul.product_category li {
float: left;
list-style: none;
}
ul.product_category {
padding: 0;
}
.product_category >li{
padding: 5px 25px;
}
.product_category >li.active{
background: #ccc;
} /* 手机版产品分类导航 */
ul.product_category_mobile>li {
padding: 5px 0;
width: 33.3%;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.product_category_mobile{
padding: 0;
}
#accordion .category_arrow{
float: right;
padding: 0 10px;
}
.panel-heading>li{
float: left;
list-style: none;
}
@media (max-width: 767px){
.pc{
display: none;
}
.mobile{
display: block;
}
} @media(min-width: 768px){
.pc{
display: block;
}
.mobile{
display: none;
}
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<nav class="navbar navbar-inverse">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand active" onclick="alert('all')">全部</a>
</div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">按场景选择 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">全部</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">规划</a></li>
<li><a href="#">实施</a></li>
<li><a href="#">维护</a></li>
</ul>
</li>
<li class="active"><a href="#">我的收藏</a></li>
<li><a href="#">最近浏览</a></li>
</ul>
<form class="navbar-form navbar-right">
<div class="input-group">
<input id="sw" type="text" class="form-control" value="请输入关键字(名称/描述)">
<span class="input-group-btn">
<button class="btn btn-default" type="button">搜索</button>
</span>
</div>
<!--
<div class="form-group">
<input id="sw" type="text" class="form-control" value="请输入关键字(名称/描述)">
</div>
<input type="button" class="btn btn-default" value="搜索"/>
-->
</form>
</div>
</nav>
</div> <!-- 产品分类 -->
<div class="row pc">
<ul class="product_category clearfix">
<li><a href="#">所有产品</a></li>
<li class="active"><a href="#">交换机</a></li>
<li><a href="#">路由器</a></li>
<li><a href="#">传送网</a></li>
<li><a href="#">WLAN</a></li>
<li><a href="#">SDN控制器</a></li>
<li><a href="#">无线局域网</a></li>
</ul>
</div> <!-- 手机端产品分类展示 -->
<div class="row mobile">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel">
<div class="panel-heading clearfix" role="tab">
<li><a href="#">所有产品</a></li>
<a class="category_arrow" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true">
<span class="glyphicon glyphicon-menu-down"></span>
</a>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<ul class="product_category product_category_mobile clearfix">
<li class="active"><a href="#">交换机</a></li>
<li><a href="#">路由器</a></li>
<li><a href="#">传送网</a></li>
<li><a href="#">WLAN</a></li>
<li><a href="#">SDN控制器</a></li>
<li><a href="#">无线局域网无线局域网无线局域网</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div> </body>
<script src="jquery/jquery.min.js"></script>
<script src="bootstrap/bootstrap.min.js"></script>
<script type="text/javascript"> </script>
</html>
bootstrap的折叠组件1的更多相关文章
- bootstrap导航条组件
一.导航条模板(官方文档) <nav class="navbar navbar-default"> <div class="container-flui ...
- 利用bootstrap的modal组件自定义alert,confirm和modal对话框
由于浏览器提供的alert和confirm框体验不好,而且浏览器没有提供一个标准的以对话框的形式显示自定义HTML的弹框函数,所以很多项目都会自定义对话框组件.本篇文章介绍自己在项目中基于bootst ...
- bootstrap轮播组件,大屏幕图片居中效果
在慕课网学习bootstrap轮播组件的时候,了解到轮播的图片都放在了类名为item下的img中 视频中老师对图片自适应采用给图片img设置width=100%完成,然而这样自适应处理图片在不同屏幕中 ...
- bootstrap 之 列表组件使用
列表是几乎所有网站都会用到的一个组件,正好bootstrap也给我们提供了这个组件的样式,下面我给大家简单介绍一下bootstrap中的列表组件的用法! 首先,重提一下引用bootstrap的核心文件 ...
- bootstrap轮播组件之“如何关闭自动轮播”
在一个页面里使用多个bootstrap轮播组件的时候,如果还让所有轮播图都自动轮播的话,整个画面都在动,会给用户一种很不好的体验感受.所以,需要关闭轮播图的自动轮播. 关闭方法:去除如下属性即可: d ...
- bootstrap课程5 bootstrap中的组件使用的注意事项是什么
bootstrap课程5 bootstrap中的组件使用的注意事项是什么 一.总结 一句话总结: 1.img-responsive的作用是什么(其实还是要多看手册)? 看起来像width=100%的效 ...
- Bootstrap Blazor Table 组件(二)
原文链接:https://www.cnblogs.com/ysmc/p/16128206.html 很多小伙伴在使用 Bootstrap Blazor Table组件的时候,都会有这样的一个需求: 我 ...
- 【BootStrap】 布局组件 I
BootStrap布局组件 I 除了在原生的HTML基础上进行了外观和类别上的改进,BS还包装了很多组件进库中,设计网页时我们可以方便地调用这些组件.下面来简略地介绍一下各种各样的组件 ■ 字体图标 ...
- bootStrap树形目录组件
需求描述 产品添加页面,需要选择车型.在bootStrap的modal上弹出子modal来使用.车型一共有4级目录.要使用目录树.然后分活动和商品两种,需要能够通过不通参数来调用该组件.车型品牌要使用 ...
随机推荐
- matlab eye 函数
eye(n,n) 产生一个n*n的单位矩阵 eye(n,m) 产生一个n*m的单位矩阵 eye(3,3) ans = 1 0 0 0 1 0 0 0 1 eye(3,4) ans = 1 0 0 0 ...
- zoj3765
题解: splay维护 注意是gcd 代码: #include<bits/stdc++.h> using namespace std; #define Key_value ch[ch[ro ...
- Ti IPNC Web网页之ActiveX控件
Ti IPNC Web网页之ActiveX控件 本篇介绍关于TI IPNC网页中播放器相关的东西. gStudio工程中添加播放器并控制播放器 打开IPNC网页时首先会自动下载ActiveX控件并安装 ...
- The disadvantage for manager has a part-time job as a trainer
At present, most companies with in-house trainers take the development model of "full-time trai ...
- Linux下系统的定时及延时任务
一.系统的延时 是临时的.对系统做的任务指定一个时间点.发起的命令是at at 时间点(now+1min) ## 设定任务实行时间 at> 执行命令 ...
- Linux下的软件的安装
一.yum相关介绍及命令 [1] 用来管理软件的一个命令.通过该命令完成对软件的下载.卸载等操作. [2] 命令:(必须在yum搭建成功后才能正常运行) yum clean all 清楚 ...
- DHL学习--<asp:literal
<asp:literal ID="ltlJS" runat="server"></asp:literal> 标签的Text属性可以放J ...
- 如何使用JFinal开发javaweb
介绍开始: 编辑器:MyEclipse; 数据库:MySQL; 服务器:tomcat; 1 首先新建web项目 要强调的是Target runtime必须选择为None.然后点击两次Next,选中创建 ...
- 编写configure.ac
configure.ac由一些宏组成(如果已经有源代码,你可以运行autoscan来产生一个configure.scan文件,在此基础修改成configure.ac将更加方便) 最基本的组成可以是下面 ...
- [Linux] jq:命令行JSON处理工具
jq命令帮助我们很方便地在终端查看和处理json文件 jq命令的帮助信息: abby@abby:bgs$ jq -h jq - commandline JSON processor [version ...