⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alai_tree_cool.js

📁 一个购房管理系统,JSF+Hibernate+Mssql2
💻 JS
字号:
/*******************************************************************************
	Tree Co0l!!!
*********************************************************************************/
function getScriptPath(js)
{
	js=js.toLowerCase()
	var script=document.getElementsByTagName("SCRIPT");
	for(var i=0;i<script.length;i++)
	{
		var s=script[i].src.toLowerCase()
		if(s.indexOf(js)!=-1)return s.replace(js,"")
	}
	return null
}

function alai_tree_cool(toObject)
{
	var path=getScriptPath("alai_tree.js")
	if(path==null){alert("run alai_tree_cool() fail, please load alai_tree.js first!");return;}
	var icons=new alai_imagelist()
	icons.path=path+"images/"
	icons.add("tree","leaf")
	icons.add("tree","twig")
	icons.add("tree","ball1")
	icons.add("tree")
	icons.add("yplus","expand")
	icons.add("yminus","collapse")
	var tree=new alai_tree(icons,0,toObject)
	tree.body.style.cssText="background:cc0001;width:170;"	
	var lastNode=null
	tree.afteradd=function(srcNode)	
	{		
		
		if(srcNode.parent!=tree.root)
		{	
			srcNode.body.style.cssText="background:cc0001;text-align:left;width:100%;color:white;cursor:hand;margin:3;font-size:10pt;"
			srcNode.parent.body.onclick=srcNode.parent.exIcon.onclick=srcNode.parent.label.click			
		}else{
			srcNode.body.style.cssText="background:cc0001;text-align:left;width:100%;color:white;cursor:hand;margin:3;font-size:15pt;"
		}
	}
	var exNode=null
	tree.onexpand=function(srcNode)
	{
		if(exNode!=null && srcNode!=exNode)exNode.expand(false);
		exNode=srcNode
	}
	tree.onmouseover=function(srcNode)
	{	if(!srcNode.hasChild)
		{
			srcNode.label.style.color="black"
			srcNode.exIcon.src=icons.item["tree"].src			
		}
	}
	tree.onmouseout=function(srcNode)
	{	if(!srcNode.hasChild)
		{	srcNode.label.style.color="white"			
			srcNode.exIcon.src=icons.item["tree"].src
		}
	}

	tree.onselect=function(){return false;}
	return tree ;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -