树形视图问题

peter_zt 2001-06-14 12:34:00
"开发门诊"主页左方的树形视图如何实现?
我想用此结构列出一些分类产品信息,初学乍练,请高手不吝赐教!
请详细举出示例代码,感激不尽!
...全文
56 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
是专家门诊还是开发文档?自己可以看看它的源代码.
回复
liulinliu 2001-06-14
在APPLET里可以实现树型图,不知道你要的是什么性质的
回复
BrentIvan 2001-06-14
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv=PRAGMA CONTENT=NO-CACHE>
<link rel="stylesheet" href="../news.css"></head>
<body bgcolor="#D6E7E7" topmargin="0" leftmargin="0">
<table width="148" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td>
<script language="JavaScript1.2">
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="KB3Parent" class="parent">
  <a href="#" onClick="expandIt('KB3'); return false"><img src="images/i_option.gif" width="20" height="16" border="0">软件开发者</a></div>
<div id="KB3Child" class="child">
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=1" target="forum">Visual C++</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=2" target="forum">Visual Basic</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=3" target="forum">Delphi</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=4" target="forum">C/C++</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=5" target="forum">C++ Builder</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=26" target="forum">Java</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=17" target="forum">C#</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=18" target="forum">XML</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=6" target="forum">ASM</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=7" target="forum">数据库开发</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=19" target="forum">数据仓库</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=8" target="forum">PowerBuilder</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=9" target="forum">ActiveX/COM</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=10" target="forum">数据算法</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=11" target="forum">软件工程</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=12" target="forum">图形/游戏/多媒体</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=13" target="forum">安全技术</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=14" target="forum">网络/通讯</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=15" target="forum">技术书籍</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=16" target="forum">文件格式</a><br>
</div>
<div id="KB2Parent" class="parent">
  <a href="#" onClick="expandIt('KB2'); return false"><img src="images/i_option.gif" width="20" height="16" border="0">计算机用户</a></div>
<div id="KB2Child" class="child">
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=41" target="forum">软件使用</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=42" target="forum">资源使用</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=43" target="forum">软件注册</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=44" target="forum">我看软件</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=45" target="forum">寻找软件</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=46" target="forum">行业软件</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=47" target="forum">软件评测</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=48" target="forum">Windows95/98</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=49" target="forum">Windows NT/2000</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=50" target="forum">DOS</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=51" target="forum">Linux/UNIX</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=52" target="forum">硬件指南</a><br>
</div>
<div id="KB4Parent" class="parent">
  <a href="#" onClick="expandIt('KB4'); return false"><img src="images/i_option.gif" width="20" height="16" border="0">Web开发者</a></div>
<div id="KB4Child" class="child">
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=21" target="forum">主页制作</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=22" target="forum">图形处理</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=23" target="forum">ASP</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=24" target="forum">PHP</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=25" target="forum">Perl</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=28" target="forum">JSP</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=27" target="forum">Javascript</a><br>

</div>
<div id="KB5Parent" class="parent">
  <a href="#" onClick="expandIt('KB5'); return false"><img src="images/i_option.gif" width="20" height="16" border="0">扩充话题</a></div>
<div id="KB5Child" class="child">
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=61" target="forum">程序人生</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=62" target="forum">软件市场</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=67" target="forum">走向海外</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=63" target="forum">程序员考试</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=64" target="forum">人才热线</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=65" target="forum">建议和意见</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=66" target="forum">灌水乐园</a><br>
</div>
  <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=68" target="forum">程序员杂志</a><br>
<div id="KB1Parent" class="parent">
  <a href="#" onClick="expandIt('KB1'); return false"><img src="images/i_option.gif" width="20" height="16" border="0">专家榜</a></div>
<div id="KB1Child" class="child">
    <img src="images/filebox.gif" width="19" height="13"><a href="topexpert.shtm" target="forum">分类专家榜</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="top50.asp" target="forum">技术专家总榜</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="mtopexpert.shtm" target="forum">技术专家月榜</a><br>
</div>
<div id="KB6Parent" class="parent">
  <a href="#" onClick="expandIt('KB6'); return false"><img src="images/i_option.gif" width="20" height="16" border="0">系统功能</a></div>
<div id="KB6Child" class="child">
    <img src="images/filebox.gif" width="19" height="13"><a href="exchange.asp" target="forum">可用分兑换</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=101" target="forum">最新贴子</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=103" target="forum">抢分区</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=100" target="forum">我的问题</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=104" target="forum">我参与的问题</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="forum.asp?room=105" target="forum">我得分的问题</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="hottopic.asp" target="forum">热点问题</a><br>
    <img src="images/filebox.gif" width="19" height="13"><a href="register.asp" target="_blank">修改个人注册信息</a><br>
</div>
</td>
</tr>
<tr><td height=100 align=center>
<a href="http://www.csdn.net/expert/topic/140/140785.shtm" target="forum">CSDN会员登记条款<br>论坛用户行为准则</a>
</td></tr>
<tr><td>
</td></tr>
</table>
</body></html>
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2001-06-14 12:34
社区公告
暂无公告