jquery做个折叠面板
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>折叠面板</title>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<style>
*{
margin:0;
padding:0;
list-style: none;
}
body{
background:#F8F8FF;
}
#flodbox{
width:500px;
margin:0 auto;
}
.flodTitle{
padding:10px;
border-bottom:1px solid #ddd;
background: #696969;
color:#ffffff;
font-weight: bold;
font-size:18px;
cursor: pointer;
position: relative;
}
.flodTitle .num{
margin-right:10px;
background:red;
}
.flodTitle .titleBox{
display: inline-block;
width:80%;
}
.flodTitle .titleRightBox{
display: inline-block;
width:18%;
height:100%;
position: absolute;
top:0;
}
.flodTitle .titleRightwraper{
position: absolute;
top:50%;
transform: translateY(-50%);
width:100%;
text-align: center;
}
.flodContentBox{
padding:0 10px;
background:#DCDCDC;
height:100%;
}
.flodContentBox>li{
padding:4px 0;
border-bottom:1px solid #F8F8FF;
}
.flodContentBox>li:last-child{
border-bottom:0;
}
.rotateLeft{
transform:rotate(-90deg);
-ms-transform:rotate(-90deg); /* IE 9 */
-moz-transform:rotate(-90deg); /* Firefox */
-webkit-transform:rotate(-90deg); /* Safari 和 Chrome */
-o-transform:rotate(-90deg); /* Opera */
}
.flodItem .flodTitle .titleRightwraper>i{
transition: all 0.5s;
-webkit-transition: all 0.5s; /* Safari */
}
</style>
</head>
<body>
<ul id="flodbox">
<li class="flodItem">
<div class="flodTitle">
<span class="titleBox">分类一</span>
<span class="titleRightBox">
<span class="titleRightwraper">
<i class="glyphicon glyphicon-chevron-down pull-right"></i>
<span class="num badge pull-right">53</span>
</span>
</span>
</div>
<ul class="flodContentBox">
<li>11</li>
<li>12</li>
<li>13</li>
</ul>
</li>
<li class="flodItem">
<div class="flodTitle">
<span class="titleBox">分类一</span>
<span class="titleRightBox">
<span class="titleRightwraper">
<i class="glyphicon glyphicon-chevron-down pull-right"></i>
<span class="num badge pull-right">53</span>
</span>
</span>
</div>
<ul class="flodContentBox">
<li>11</li>
<li>12</li>
<li>13</li>
</ul>
</li>
<li class="flodItem">
<div class="flodTitle">
<span class="titleBox">分类一</span>
<span class="titleRightBox">
<span class="titleRightwraper">
<i class="glyphicon glyphicon-chevron-down pull-right"></i>
<span class="num badge pull-right">53</span>
</span>
</span>
</div>
<ul class="flodContentBox">
<li>11</li>
<li>12</li>
<li>13</li>
</ul>
</li>
</ul> <script>
$(function(){
$("#flodbox>.flodItem>.flodTitle").click(function(){
if($(this).find("i").hasClass("rotateLeft")){
$(this).find("i").removeClass("rotateLeft");
$(this).parent().find(".flodContentBox").slideDown();;
}else{
$(this).find("i").addClass("rotateLeft");
$(this).parent().find(".flodContentBox").slideUp();
}
})
})
</script>
</body>
</html>

jquery做个折叠面板的更多相关文章
- jquery实现通用结构折叠面板效果
效果截图: 说明:可以任意添加多个类似结构样式,点击标题栏图片对应隐藏.显示. jquery代码: 思路一:基本方法 <script src="http://apps.bdimg.co ...
- jquery ui 常用(一)(自动完成 | 标签页 | 折叠面板 | 带图标的按钮 | 日期选择器| )
条件,引用3个文件 jquery-ui.min.css; jquery.min.js; jquery-ui.min.js. 一.自动完成 http://www.w3cschool.cc/jqueryu ...
- jQuery EasyUI 折叠面板accordion的使用实例
1.对折叠面板区域 div 设置 class=”easyui-accordion” 2.在区域添加多个 div, 每个 div 就是一个面板 (每个面板一定要设置 title 属性). 3.设置面板属 ...
- Jquery Accordion 折叠面板
属性 类型 默认值 active Boolean/Number/jQuery/Selector/Element 第一个面板 设定默认显示的面板.设置为 false 时默认不显示面板,需 collaps ...
- 布局-EasyUI Panel 面板、EasyUI Tabs 标签页/选项卡、EasyUI Accordion 折叠面板、EasyUI Layout 布局
EasyUI Panel 面板 通过 $.fn.panel.defaults 重写默认的 defaults. 面板(panel)当做其他内容的容器使用.它是创建其他组件(比如:Layout 布局.Ta ...
- CSS实现折叠面板
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- layui中折叠面板的使用
运用折叠面板后 可以让页面更加整洁 有什么不懂的可以留言 代码放到底部 需要引入的文件 JQuery代码: html代码 <div class="layui-colla-item&qu ...
- 第一百九十九节,jQuery EasyUI,Panel(面板)组件
jQuery EasyUI,Panel(面板)组件 学习要点: 1.加载方式 2.属性列表 3.事件列表 4.方法列表 本节课重点了解EasyUI中Panel(面板)组件的使用方法,这个组件不依赖于其 ...
- jQuery Easy UI Panel(面板)组件
panel(面板)组件,跟前面的组件使用方法差点儿都差点儿相同,也是从设置一些面板属性.操作面板触发的事件.我们可针对面板对象的操作方法这三个点去学习. 后面有一些组件要依赖于这个组件. 另一点跟前面 ...
随机推荐
- 写一个vue的滚动条插件
组件源码如下: vue-scroll.vue <template> <div class="vue-scroll" ref="vueScrollW&qu ...
- css 省略号的写法
单行省略号 overflow: hidden; text-overflow:ellipsis; white-space: nowrap; width:500px; 多行省略号 overflow: hi ...
- kafka的生产者配置以及发送信息的三种方式
1.Fire-and-forget 这种方式是不管发送成功与否,客户端都会返回成功.尽管大多数的时候Kafka 在发送失败后,会自己重新自动再一次发送消息,但是也会存在丢失消息的风险 Producer ...
- 在论坛中出现的比较难的sql问题:30(row_number函数 物料组合问题)
原文:在论坛中出现的比较难的sql问题:30(row_number函数 物料组合问题) 在论坛中,遇到了不少比较难的sql问题,虽然自己都能解决,但发现过几天后,就记不起来了,也忘记解决的方法了. 所 ...
- TextBox 显示横线
public class Xtxt3 : TextBox { private bool m_underLine; public bool UnderLine { get { return m_unde ...
- 【转载】Windows检测到IP地址冲突
今天在使用电脑的过程中,突然弹出个提示,Windows检测到IP地址冲突,此网络中的另一台计算机与该计算机的IP地址相同.联系你的网络管理员解决此问题,有关详细信息,请参阅Windows系统日志.查阅 ...
- 【转载】C#编程中两个List集合使用Intersect方法求交集
在C#语言程序设计中,List集合是常用的集合数据类型,在涉及集合类型的运算中,有时候我们需要计算2个List集合中共有的数据,即对2个List集合求交集运算.此时可以使用C#语言提供的Interse ...
- USB原理简单叙述
USB简介: USB的几种版本: 1. USB 1.0:速度 1.5Mb/s 2. USB 1.1:速度 12Mb/s 3. USB 2.0:速度 60MbB/s 4. USB 3.0:速度 640M ...
- ORA-03113:通信通道的文件结尾 解决办法
登录Oracle时出现错误:“ORA-03113:通信通道的文件结尾” 错误排查方法 Oracle出现错误,查看trace日志寻找问题根源:D:\oracle\diag\rdbms\orcl\orcl ...
- 深入理解JVM内幕:从基本结构到Java 7新特性[转]
英文原文:cubrid,编译:ImportNew - 朱伟杰 译文链接:http://www.importnew.com/1486.html [如需转载,请在正文中标注并保留原文链接.译文链接和译者等 ...