bootstrap 树
http://jsfiddle.net/jhfrench/GpdgF/
把原文的i标签中的图标显示出来;
源码:
<div class="tree well">
<ul>
<li><span><i
class="glyphicon glyphicon-folder-open"></i> Parent</span> <a
href="">Goes somewhere</a>
<ul>
<li><span><i class="glyphicon glyphicon-minus"></i>Child</span>
<a href="">Goes somewhere</a>
<ul>
<li><span><i class="glyphicon glyphicon-leaf"></i>
Grand Child</span> <a href="">Goes somewhere</a></li>
</ul></li>
</ul></li>
<li><span><i class="icon-folder-open"></i> Parent2</span> <a
href="">Goes somewhere</a>
<ul>
<li><span><i class="icon-leaf"></i> Child</span> <a
href="">Goes somewhere</a></li>
</ul></li>
</ul>
</div>
css:
.tree {
min-height:20px;
padding:19px;
margin-bottom:20px;
background-color:#fbfbfb;
border:1px solid #;
-webkit-border-radius:4px;
-moz-border-radius:4px;
border-radius:4px;
-webkit-box-shadow:inset 1px 1px rgba(, , , 0.05);
-moz-box-shadow:inset 1px 1px rgba(, , , 0.05);
box-shadow:inset 1px 1px rgba(, , , 0.05)
}
.tree li {
list-style-type:none;
margin:;
padding:10px 5px 5px;
position:relative
}
.tree li::before, .tree li::after {
content:'';
left:-20px;
position:absolute;
right:auto
}
.tree li::before {
border-left:1px solid #;
bottom:50px;
height:%;
top:;
width:1px
}
.tree li::after {
border-top:1px solid #;
height:20px;
top:25px;
width:25px
}
.tree li span {
-moz-border-radius:5px;
-webkit-border-radius:5px;
border:1px solid #;
border-radius:5px;
display:inline-block;
padding:3px 8px;
text-decoration:none
}
.tree li.parent_li>span {
cursor:pointer
}
.tree>ul>li::before, .tree>ul>li::after {
border:
}
.tree li:last-child::before {
height:30px
}
.tree li.parent_li>span:hover, .tree li.parent_li>span:hover+ul li span {
background:#eee;
border:1px solid #94a0b4;
color:#
}
js:
$(function() {
$('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title',
'点击收缩');
$('.tree li.parent_li > span').on(
'click',
function(e) {
var children = $(this).parent('li.parent_li')
.find(' > ul > li');
if (children.is(":visible")) {
children.hide('fast');
$(this).attr('title', '点击展开').find(' > i').addClass(
'glyphicon-plus').removeClass('glyphicon-minus');
} else {
children.show('fast');
$(this).attr('title', '点击收缩').find(' > i').addClass(
'glyphicon-minus').removeClass('glyphicon-plus');
}
e.stopPropagation();
});
});
bootstrap 树的更多相关文章
- js插件---Bootstrap 树控件
js插件---Bootstrap 树控件 一.总结 一句话总结:可以直接用gojs,或者搜索js,jquery的树控件,或者bootstrap树控件,一大堆 gojs 二.JS组件系列——Bootst ...
- JS组件系列——Bootstrap 树控件使用经验分享
前言:很多时候我们在项目中需要用到树,有些树仅仅是展示层级关系,有些树是为了展示和编辑层级关系,还有些树是为了选中项然后其他地方调用选中项.不管怎么样,树控件都是很多项目里面不可或缺的组件之一.今天, ...
- Bootstrap树控件(Tree控件组件)使用经验分享
前言:很多时候我们在项目中需要用到树,有些树仅仅是展示层级关系,有些树是为了展示和编辑层级关系,还有些树是为了选中项然后其他地方调用选中项.不管怎么样,树控件都是很多项目里面不可或缺的组件之一.今天, ...
- 基于bootstrap样式的tree,
<!doctype html><html lang="zh"><head> <meta charset="UTF-8" ...
- JS组件系列——分享自己封装的Bootstrap树形组件:jqTree
前言:之前的一篇介绍了下如何封装自己的组件,这篇再次来体验下自己封装组件的乐趣.看过博主博客的园友应该记得之前分享过一篇树形菜单的使用JS组件系列——Bootstrap 树控件使用经验分享,这篇里面第 ...
- UI 收集
semantic http://www.semantic-ui.com.cn/modules/reveal.html sbadmin http://startbootstrap.com/templat ...
- Uber使用Swift重写APP的踩坑经历及解决方案(转载)
本文出自Uber移动架构和框架组负责人托马斯·阿特曼于2016年在湾区Swift峰会上的演讲,分享了使用Swfit重写Uber的好与坏.以下为译文: 我是托马斯·阿特曼,目前是Uber移动架构和框架组 ...
- 15、使用ggtree实现进化树的可视化和注释(转载)
本文作者:余光创,目前就读于香港大学公共卫生系,开发过多个R/Bioconductor包,包括ChIPseeker, clusterProfiler, DOSE,ggtree,GOSemSim和Rea ...
- iscroll.js的简单使用方法
参考链接:https://www.cnblogs.com/Renyi-Fan/tag/js%E6%8F%92%E4%BB%B6/default.html?page=2 目录 一.总结 一句话总结:Sc ...
随机推荐
- StrictMode使用详解
http://hb.qq.com/a/20110914/000054.htm http://www.android100.org/html/201204/25/1097.html http://www ...
- 25个最佳最闪亮的Eclipse开发项目
http://blog.csdn.net/howareyoutodayyhz/article/details/8264599 25个最佳最闪亮的Eclipse开发项目 标签: eclipseEclip ...
- 轻量级别的Cache和反向代理软件---Varnish
1.Varnish描述 1.1 Varnish的结构与特点 Varnish是一个轻量级别的Cache和反向代理软件,先进的设计理念和成熟的设计框架是Varnish的主要特点: 基于内存进行缓存,重启后 ...
- 用Quick Cocos2dx做一个连连看(二)
今天完成了以下内容: 1 成对生成SpriteItem 2 重排接口制作完成 3 SpriteItem的选择逻辑 主要代码如下: function MainScene:onEnter() local ...
- java中关于编码的问题(字符转换流及字符缓冲流 )
上次我们使用的是字节流,还有一种方式就是字符流,上次说过如何分辨使用哪种流,如果记事本可以读懂则使用字符流,否则使用字节流.使用字符流就需要牵扯到编码的问题,下面给出一种转化流的格式. OutputS ...
- 如何成为一名优秀的UI设计师
zccst整理 因为我自己就是一个 0 美术基础.非计算机.非艺术类科班出身,但从事视觉设计工作的同学,所以很多和题主一样大学里学着不喜欢的专业,想要转设计但又不知从何开始的朋友都来问过我类似的问题, ...
- HTML编辑模式下制作表格
前面有朋友问如何做图文并茂的音乐帖子,的确音乐能以表格式做出来,更能让人过目不忘,何况帖子制作过程本身就是创作,包含了制作人对音乐的理解和爱好.以下简单介绍用代码HTML制作表格,希望对大家有所帮助. ...
- UVA 10518 How Many Calls?
题意:一个递推式第n项%b是多少. 递推式: 构造矩阵: #include<cstdio> #include<cstring> #include<cmath> #i ...
- iOS开发——NSDate(待续...)
1.获取当前系统时间,毫秒级 - (void)viewDidLoad { [super viewDidLoad]; NSString *currentTime = [self getCurrentTi ...
- Javascript 页面刷新
Javascript 页面刷新的实现代码收藏 1 2 3 4 5 6 7 8 history.go(0) location.reload() location=location location.as ...