jQuery文件目录树插件

来源:https://www.sucaihuo.com/js/2633.html 2017-08-04 22:04浏览(2343) 收藏

一款jQuery文件目录树插件,可以自由设置目录的内容或层级,当然啦,目录的图标也是可以自由更换的哦,喜欢的童鞋请收下吧。
jQuery文件目录树插件
分类:导航菜单 > 图标导航 难易:初级
查看演示 下载资源 下载积分: 20 积分

页面的head部分,需设置好页面元素的样式,代码如下:

<style type="text/css">
* { margin: 0; padding: 0; }
body { font-size: 14px; color: #333; font-family: 'Microsoft YaHei','Lantinghei SC','Open Sans',Arial,'Hiragino Sans GB','STHeiti','WenQuanYi Micro Hei','SimSun',sans-serif; }
ul, li { list-style-type: none; }

#treeView {
  width: 600px;
  margin: 20px auto 0;
  border: 1px solid #f2f2f2;
}
.treeNode {
  height: 32px;
  border: 1px solid #fff;
  border-width: 1px 0;
  cursor: pointer;
  font-size: 0;
}
.treeNode:hover {
  background: #f4f9fd;
  border-color: #e5f0fb;
}
.treeNode-cur,
.treeNode-cur:hover {
  background: #e5f0fb;
  border-color: #BBD4EF #fff;
}
.icon {
  display: inline-block;
  background: url(images/icon.png) no-repeat;
  vertical-align: middle;
}
.icon-minus {
  width: 15px;
  height: 15px;
  margin: 0 4px;
  background-position: -30px -22px;
}
.icon-add {
  width: 15px;
  height: 15px;
  margin: 0 4px;
  background-position: -30px 0;
}
.icon-file {
  width: 22px;
  height: 18px;
  margin-right: 5px;
  background-position: 0 -22px;
}
.title {
  position: relative;
  top: 6px;
  font-size: 14px;
}

.treeNode-empty .icon-minus {
  background-position: -999px -999px;
}
.treeNode-empty .icon-add {
  background-position: -999px -999px;
}

#treeView ul.none {
  display: none;
}
</style>

页面的body部分,仅需一个指定id的div容器即可,代码如下:

<div id="treeView"></div>

页面的底部,需引入4个必要的JS文件,代码如下:

<script type="text/javascript" src='js/data.js'></script>
<script type="text/javascript" src='js/tools.js'></script>
<script type="text/javascript" src='js/handledata.js'></script>
<script type="text/javascript" src='js/index.js'></script>
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2