zoukankan      html  css  js  c++  java
  • jquery Ztree v3.5 实例2 自定义显示在节点前的图片

    显示效果如下:

    代码如下:

    <html>
    	<head><title></title></head>
    	<script type="text/javascript" src="jquery-1.10.2.js"></script>
    	<script type="text/javascript" src="jquery.ztree.all-3.5.min.js"></script>
    	<link href="zTreeStyle.css" rel="stylesheet" type="text/css"/>
    		<style type="text/css">
    .ztree li span.button.pIcon01_ico_open{margin-right:2px; background: url(img/diy/1_open.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
    .ztree li span.button.pIcon01_ico_close{margin-right:2px; background: url(img/diy/1_close.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
    .ztree li span.button.pIcon02_ico_open, .ztree li span.button.pIcon02_ico_close{margin-right:2px; background: url(img/diy/2.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
    .ztree li span.button.icon01_ico_docu{margin-right:2px; background: url(img/diy/3.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
    .ztree li span.button.icon02_ico_docu{margin-right:2px; background: url(img/diy/4.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
    .ztree li span.button.icon03_ico_docu{margin-right:2px; background: url(img/diy/5.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
    .ztree li span.button.icon04_ico_docu{margin-right:2px; background: url(img/diy/6.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
    .ztree li span.button.icon05_ico_docu{margin-right:2px; background: url(img/diy/7.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
    .ztree li span.button.icon06_ico_docu{margin-right:2px; background: url(img/diy/8.png) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
    	</style>
    	<script type="text/javascript">
    	var setting = {
    			data: {
    				simpleData: {
    					enable: true
    				}
    			}
    		};
    
    	var zNodes =[
    			{ id:1, pId:0, name:"展开、折叠 自定义图标不同", open:true, iconSkin:"pIcon01"},
    			{ id:11, pId:1, name:"叶子节点1", iconSkin:"icon01"},
    			{ id:12, pId:1, name:"叶子节点2", iconSkin:"icon02"},
    			{ id:13, pId:1, name:"叶子节点3", iconSkin:"icon03"},
    			{ id:2, pId:0, name:"展开、折叠 自定义图标相同", open:true, iconSkin:"pIcon02"},
    			{ id:21, pId:2, name:"叶子节点1", iconSkin:"icon04"},
    			{ id:22, pId:2, name:"叶子节点2", iconSkin:"icon05"},
    			{ id:23, pId:2, name:"叶子节点3", iconSkin:"icon06"},
    			{ id:3, pId:0, name:"不使用自定义图标", open:true },
    			{ id:31, pId:3, name:"叶子节点1"},
    			{ id:32, pId:3, name:"叶子节点2"},
    			{ id:33, pId:3, name:"叶子节点3"}
    		];
    
    	$(document).ready(function(){
    			$.fn.zTree.init($("#tree"), setting, zNodes);
    		});
    	</script>
    	<body>
    		<ul id="tree" class="ztree"></ul>
    	</body>
    </html>


     

  • 相关阅读:
    Java实现 蓝桥杯VIP 算法训练 装箱问题
    Java实现 蓝桥杯VIP 算法训练 入学考试
    Qt4.6.2已编译二进制版本在VS2005中的问题
    函数可重入问题reentrant functions(函数执行过程中可以被中断,允许多个副本)
    QT的Paint 系统
    取clientdataset detal中的 更新数据, 将detal 转 数据库脚本sql
    delphi 八字排盘源码(post数据以后,又分析数据)
    Working with Entity Relations in OData
    图片轮播插件Nivo Slider
    跨域访问 REST API
  • 原文地址:https://www.cnblogs.com/pangblog/p/3271507.html
Copyright © 2011-2022 走看看