欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

COTree公司组织结构树控件js特效 博客分类: htmlJqueryjs htmljs 

程序员文章站 2024-03-15 21:03:57
...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>分享一款ECOTree公司组织结构树控件js特效</title>
<script type="text/javascript" src="ECOTree.js"></script>
<link type="text/css" rel="stylesheet" href="ECOTree.css" />
<style>
v\:*{ behavior:url(#default#VML);}
</style>
<style>
	.copy {
		font-family : "Verdana";				
		font-size : 10px;
		color : #CCCCCC;
	}	
</style>
<script>
var myTree = null;			
function CreateTree() {
	myTree = new ECOTree('myTree','myTreeContainer');	
	myTree.config.colorStyle = ECOTree.CS_LEVEL;
	myTree.config.nodeFill = ECOTree.NF_FLAT;
	myTree.config.selectMode = ECOTree.SL_NONE;				
	//是否允许给节点加链接,是否允许给节点加图片
	myTree.config.useTarget = false;                
	myTree.config.useImg = true;       

  //设置节点的大小和间隔
	myTree.config.defaultNodeWidth = 95;
	myTree.config.defaultNodeHeight = 140;
	myTree.config.iSubtreeSeparation = 50;
	myTree.config.iSiblingSeparation = 15;
	myTree.config.iLevelSeparation = 30;

	//此处通过从数据库或其它地方读取节点信息,生成添加节点的代码
	//参数前三位是必须的;
	//第一位是本节点id,第二位是父节点id、根节点的父节点为-1,第三位为节点文本;
	//第四位为节点上显示的图片/照片、图片放到img下并在数据库中记录名称即可,未设参数则取默认图片;
	//第五位为超链接、最好是访问统一程序传入本节点id;
	//第六、七位为节点的个性化宽、高。
	myTree.add('01',-1,'总裁','./img/0.jpg','http://www.jq-school.com');
	
	myTree.add('02','01','技术副总裁','./img/1.jpg');
	myTree.add('03','01','总裁助理','./img/2.jpg','http://www.jq-school.com',95,130);
	myTree.add('04','01','分公司','./img/3.jpg','http://www.jq-school.com',95,130);

	myTree.add('0201','02','技术经理','./img/4.jpg','http://www.jq-school.com',95,130);
	myTree.add('0202','02','技术员','./img/5.jpg','http://www.jq-school.com',95,130);
	myTree.add('0301','03','秘书','./img/5.jpg','http://www.jq-school.com',95,130);
	myTree.add('0302','03','助理','./img/6.jpg','http://www.jq-school.com',95,130);
	myTree.add('0401','04','总经理','./img/6.jpg','http://www.jq-school.com',95,130);
	myTree.add('0402','04','财务','./img/7.jpg','http://www.jq-school.com',95,130);

	myTree.UpdateTree();
}		

</script>
</head>
<div align="center"><table border="0" width="746" height="22"><tr><td height="18" width="740"> 
<body onLoad="CreateTree();">
<div id="myTreeContainer"></div>
</td></tr></table>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div style="text-align:center;clear:both">
<p>适用浏览器:IE8、360、世界之窗.</p>
<p>注:FireFox、Chrome、Safari、Opera、傲游、搜狗等浏览器不能显示出线条。</p>
<p>来源:<a href="http://www.jq-school.com/">jq-school</a></p>
</div>
</body>
</html>
相关标签: html js