哪位大侠有用javascript写的树形代码,能动态添加的那种? http://www.vckbase.com/code/listcode.asp?mclsid=22&sclsid=2201js+xml+xsl 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <body bgcolor="#ffdeb5" ><table align="left"><script language="JavaScript">NS4 = (document.layers) ? 1 : 0;IE4 = (document.all) ? 1 : 0;ver4 = (NS4 || IE4) ? 1 : 0;if (ver4) { with (document) { write("<STYLE TYPE='text/css'>"); if (NS4) { write(".parent {position:absolute; visibility:visible}"); write(".child {position:absolute; visibility:visible}"); write(".regular {position:absolute; visibility:visible}") } else { write(".child {display:none}") } write("</STYLE>"); }}function getIndex(el) { ind = null; for (i=0; i<document.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.id == el) { ind = i; break; } } return ind;}function arrange() { nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height; for (i=firstInd+1; i<document.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.visibility != "hide") { whichEl.pageY = nextY; nextY += whichEl.document.height; } }}function initIt(){ if (!ver4) return; if (NS4) { for (i=0; i<document.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide"; } arrange(); } else { divColl = document.all.tags("DIV"); for (i=0; i<divColl.length; i++) { whichEl = divColl(i); if (whichEl.className == "child") whichEl.style.display = "none"; } }}function expandIt(el) { if (!ver4) return; if (IE4) { whichEl = eval(el + "Child"); if (whichEl.style.display == "none") { whichEl.style.display = "block"; } else { whichEl.style.display = "none"; } } else { whichEl = eval("document." + el + "Child"); if (whichEl.visibility == "hide") { whichEl.visibility = "show"; } else { whichEl.visibility = "hide"; } arrange(); }}onload = initIt;</script> <p></p> <div id="KB1Parent" class="parent"><A onclick="expandIt('KB1'); return false" href ="#" ><IMG src="img/plus.gif" border=0 name=kb1><font class="tt">政务服务</font></a></div> <div id="KB1Child" class="child"> <A href="gov_affair/gov_announce/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">政务通告</font></a><br> <A href="gov_affair/gov_apply/manager.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">政务申请</font></a><br> <A href="gov_affair/gov_pass/manager.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">政务获审通告</font></a><br> <A href="gov_affair/gov_consult/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">政务咨询</font></a></div> <div id="KB2Parent" class="parent"><A onclick="expandIt('KB2'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">产权服务</font></a></div> <div id="KB2Child" class="child"> <A href="patent/apply/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">产权申报信息</font></a><br> <A href="patent/pass/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">获审产权通告</font></a><br> <A href="patent/table/uploadfrm.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">产权申报表</font></a><br> <A href="patent/contract/uploadfrm.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">合同样本</font></a></div> <div id="KB9Parent" class="parent"><A onclick="expandIt('KB9'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">发布技术交易</font></a></div> <div id="KB9Child" class="child"> <A href="technicaltrade/tech_transfer/index.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">技术转让</font></a><br> <A href="technicaltrade/tech_demand/index.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">技术需求</font></a><br> <A href="technicaltrade/tnew_prod/index.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">最新产品</font></a><br> <A href="technicaltrade/TSCIEN_FINANCE/index.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">科技融资</font></a></div> <div id="KB8Parent" class="parent"><A onclick="expandIt('KB8'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">技术交易回复</font></a></div> <div id="KB8Child" class="child"> <A href="technicaltrade/ans_tech_transfer/index.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">技术转让</font></a><br> <A href="technicaltrade/ans_tech_demand/index.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">技术需求</font></a><br> <A href="technicaltrade/ans_tnew_prod/index.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">最新产品</font></a><br> <A href="technicaltrade/ans_TSCIEN_FINANCE/index.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">科技融资</font></a></div> <div id="KB4Parent" class="parent"><A onclick="expandIt('KB4'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">科技会展</font></a></div> <div id="KB4Child" class="child"> <A href="exhibition/ex_info/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">展会信息</font></a><br> <A href="exhibition/ex_special/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">展会专题</font></a><br> <A href="exhibition/ex_hall/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">会员展厅</font></a></div> <div id="KB5Parent" class="parent"><A onclick="expandIt('KB5'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">民科数据库</font></a></div> <div id="KB5Child" class="child"> <A href="database/productions/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">科技成果</font></a><br> <A href="database/patent/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">技术专利</font></a><br> <A href="database/product/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">产品数据库</font></a></div> <div id="KB12Parent" class="parent"><A onclick="expandIt('KB12'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">服务指南</font></a></div> <div id="KB12Child" class="child"> <A href="law_policy/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">政策法规</font></a><br> <A href="news/news_manage/select.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">科技动态</font></a><br> <A href="star/star_manage/tax_type.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">明星企业</font></a></div> <script language="JavaScript">if (NS4) { firstEl = "KB1Parent"; firstInd = getIndex(firstEl); arrange();} </script> 我收集了几个,你留下email,你看看怎样 to: genuis(不死鸟) 只有一层吗?能动态添加吗?好像不可以的吧?to: gyn(hihi) 多谢,可惜我不会!收贴了 JS 如何把div里面面的内容生成 快照呢? jqGrid如何刷新colModel js如何获得table的值 窗口显示文字的问题还未解决! 怎么写一个js给右键弹出的pop-window附加css样式? 请教一关于画线问题,马上给分!!! 如何给帧结构中某个帧里的一个帧页面定一个特定页面??? SCRIPT5: 拒绝访问 求一个先一个先验证身份证号码有效性,再获得出生日期、性别的程序。 这是什么问题呀?半天没找到原因 数组的表示方法 请问怎样在web页中禁止鼠标右键???
<table align="left">
<script language="JavaScript">
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;if (ver4) {
with (document) {
write("<STYLE TYPE='text/css'>");
if (NS4) {
write(".parent {position:absolute; visibility:visible}");
write(".child {position:absolute; visibility:visible}");
write(".regular {position:absolute; visibility:visible}")
}
else {
write(".child {display:none}")
}
write("</STYLE>");
}
}function getIndex(el) {
ind = null;
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id == el) {
ind = i;
break;
}
}
return ind;
}function arrange() {
nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY = nextY;
nextY += whichEl.document.height;
}
}
}function initIt(){
if (!ver4) return;
if (NS4) {
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
}
arrange();
}
else {
divColl = document.all.tags("DIV");
for (i=0; i<divColl.length; i++) {
whichEl = divColl(i);
if (whichEl.className == "child") whichEl.style.display = "none";
}
}
}function expandIt(el) {
if (!ver4) return;
if (IE4) {
whichEl = eval(el + "Child");
if (whichEl.style.display == "none") {
whichEl.style.display = "block";
}
else {
whichEl.style.display = "none";
}
}
else {
whichEl = eval("document." + el + "Child");
if (whichEl.visibility == "hide") {
whichEl.visibility = "show";
}
else {
whichEl.visibility = "hide";
}
arrange();
}
}
onload = initIt;
</script>
<div id="KB1Parent" class="parent"><A onclick="expandIt('KB1'); return false" href ="#" ><IMG src="img/plus.gif" border=0 name=kb1><font class="tt">政务服务</font></a></div>
<div id="KB1Child" class="child"> <A href="gov_affair/gov_announce/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">政务通告</font></a><br> <A href="gov_affair/gov_apply/manager.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">政务申请</font></a><br> <A href="gov_affair/gov_pass/manager.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">政务获审通告</font></a><br> <A href="gov_affair/gov_consult/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">政务咨询</font></a></div>
<div id="KB2Parent" class="parent"><A onclick="expandIt('KB2'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">产权服务</font></a></div>
<div id="KB2Child" class="child"> <A href="patent/apply/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">产权申报信息</font></a><br> <A href="patent/pass/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">获审产权通告</font></a><br> <A href="patent/table/uploadfrm.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">产权申报表</font></a><br> <A href="patent/contract/uploadfrm.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">合同样本</font></a></div>
<div id="KB9Parent" class="parent"><A onclick="expandIt('KB9'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">发布技术交易</font></a></div>
<div id="KB9Child" class="child"> <A href="technicaltrade/tech_transfer/index.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">技术转让</font></a><br> <A href="technicaltrade/tech_demand/index.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">技术需求</font></a><br> <A href="technicaltrade/tnew_prod/index.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">最新产品</font></a><br> <A href="technicaltrade/TSCIEN_FINANCE/index.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">科技融资</font></a></div>
<div id="KB8Parent" class="parent"><A onclick="expandIt('KB8'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">技术交易回复</font></a></div>
<div id="KB8Child" class="child"> <A href="technicaltrade/ans_tech_transfer/index.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">技术转让</font></a><br> <A href="technicaltrade/ans_tech_demand/index.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">技术需求</font></a><br> <A href="technicaltrade/ans_tnew_prod/index.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">最新产品</font></a><br> <A href="technicaltrade/ans_TSCIEN_FINANCE/index.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">科技融资</font></a></div>
<div id="KB4Parent" class="parent"><A onclick="expandIt('KB4'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">科技会展</font></a></div>
<div id="KB4Child" class="child"> <A href="exhibition/ex_info/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">展会信息</font></a><br> <A href="exhibition/ex_special/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">展会专题</font></a><br> <A href="exhibition/ex_hall/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">会员展厅</font></a></div>
<div id="KB5Parent" class="parent"><A onclick="expandIt('KB5'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">民科数据库</font></a></div>
<div id="KB5Child" class="child"> <A href="database/productions/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">科技成果</font></a><br> <A href="database/patent/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">技术专利</font></a><br> <A href="database/product/manager.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">产品数据库</font></a></div>
<div id="KB12Parent" class="parent"><A onclick="expandIt('KB12'); return false" href ="#" ><IMG src="img/plus.gif" border=0><font class="tt">服务指南</font></a></div>
<div id="KB12Child" class="child"> <A href="law_policy/manager.asp" target=right><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">政策法规</font></a><br> <A href="news/news_manage/select.asp" target=right ><IMG alt="" src="img/spacer.gif" border=0><IMG src="img/open.gif" border=0><font class="tt">科技动态</font></a><br> <A href="star/star_manage/tax_type.asp" target=right ><IMG height=11 alt="" src="img/spacer.gif" width=15 border=0><IMG src="img/open.gif" border=0><font class="tt">明星企业</font></a></div> <script language="JavaScript">
if (NS4) {
firstEl = "KB1Parent";
firstInd = getIndex(firstEl);
arrange();
}
</script>