Home > Web Front-end > JS Tutorial > Introduction to the use of a tree plug-in (OrangeTree) based on jQuery_jquery

Introduction to the use of a tree plug-in (OrangeTree) based on jQuery_jquery

WBOY
Release: 2016-05-16 17:53:56
Original
1319 people have browsed it

OrangeTree
下载地址:OrangeTree

首先大家先看下演示吧!
首先声明本人美术功底比较差!这个样式大家就将就一下吧!我将这个无限级树型插件命名为桔子树,它主要就分为3个级别的节点:

首级菜单,就是树上的一级菜单
父级菜单,也就是下面还有节点的菜单
子级菜单,也就是下面没有节点的菜单
每个节点都可以用CSS控制其样式,详细请看下表:

OrangeTree

.OrangeTree 控件
.first_node 首级菜单的默认样式
.first_node_hover 首级菜单鼠标移上的样式
.first_node_click 首级菜单鼠标点击后的样式
.first_node_subItem 首级菜单下的子级菜单样式
.Item 父级菜单
.Item_node 父级菜单默认样式
.Item_node_hover 父级菜单鼠标移上的样式
.Item_node_click 父级菜单鼠标点击后的样式
.Item_Img_bg 父级菜单图标样式
.subItem 子级菜单
.subItem span 子级菜单默认样式
.subItem_node_hover 子级菜单鼠标移上的样式
.subItem_node_click 子级菜单鼠标点击后的样式
.subItem_Img_bg 子级菜单图标样式
注:注释为(*)的样式建议不要修改

JavaScript参数说明:

OrangeTree
width 控件宽度
height 控件高度
indent 层级缩进
view 初始显示方式,expanded:全部打开,collapsed:全部关闭,firstNode:指定显示首级的第几级(firstNode指定)
firstNode view为firstNode此属性指定显示首级的第几级
single 指定显示方式,是否只能开打一级目录
The specific usage is as follows:
First add a reference
Copy the code The code is as follows:

< link href="Styles/OrangeTree.css" rel="stylesheet" type="text/css" />



HTML
Copy code The code is as follows:



  • ……

  • ……



Javascript
Copy code The code is as follows:

$(document).ready(function() {
$(".OrangeTree").OrangeTree({
width: "300px",
height: "500px",
indent:20,
view: "collapsed",
firstNode : 1,
single:false
});
});
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template