xml无限级的树-xml教程
转载自:互联网 作者:cd3c.com
您正在看的xml教程是:xml无限级的树。
Tree.XML
Tree.xsl
var CurrentNode = null;
var iconLeaf = ".";
var iconExpand = "-";
var iconCollapse = "+";
function Expand(obj)
{
var div = null;
var img = obj;
if(obj.tagName != 'SPAN' || obj.className!='clsSpace')
return (false);
obj = obj.parentElement;
var childRen=obj.children;
for (var i=0;i < childRen.length;i++)
{
if(childRen[i].tagName == 'DIV'){
div = childRen[i];
break;
}
}
if(div == null)
return (false);
if(obj.Expanded.toLowerCase()=='true')
{
if(img!=null) img.innerHTML = iconCollapse;
obj.Expanded='false';
div.className='hide';
}
else
{
if(img!=null) img.innerHTML = iconExpand;
obj.Expanded='true';
div.className='shown'
}
}
function MouseOver(obj)
{
obj.className = "clsMouseOver";
}
function MouseOut(obj)
{
if(!obj.Checked)
obj.className = "clsLabel";
else
obj.className = "clsCurrentHasFocus";
}
function MouseDown(obj)
{
obj.className = "clsMouseDown";
}
function MouseUp(obj)
{
MouseOut(obj);
}
function Click(obj)
{
if(!obj.Checked)
{
if(CurrentNode != null)
{
CurrentNode.Checked = false;
MouseOut(CurrentNode);
}
obj.Checked = true;
CurrentNode = obj;
}
else
obj.Checked = false;
MouseOut(obj);
}
]]>
BODY
{
cursor:default;
font-size:9pt;
background-color:#F1F1F1;
}
span
{
padding:2px 3px;
position:relative;
display:inline;
top:-2px;
height:17px;
border: solid 1px #f1f1f1;
}
span.clsLabel
{
}
SPAN.clsSpace
{
font-family:verdana;
position:rel
[1] [2] [3] 下一篇
