各位都是用什么实现树结构?JTree?还是 JavaScript?

柯嘉 2003-04-30 07:51:13
RT.
...全文
759 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
glucose 2003-05-02
  • 打赏
  • 举报
回复
Fash template非常简单
选择new from template
选择menus
修改XML文件即可得到自己的树状菜单
xqi8 2003-05-02
  • 打赏
  • 举报
回复
<html>

<head>

<title>tree</title>
<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>
<base target="main">
</head>

<body>
<table border="0" width="92">
<tr>
<td width="82">
<table border="0" width="222" height="217">
<tr>
<TD vAlign=top bgColor=#f7fff7 width="216" height="211">

<DIV class=parent id=KB0Parent><A
onclick="expandIt('KB0'); return false"
href="http://www.tqbooks.com/#"><IMG height=22
src="plus1.gif" width=20
border=0>JAVA</A></DIV>
<DIV class=child id=KB0Child style="width: 110; height: 156"> <IMG height=15
src="plus2.gif" width=15><A
href="http:">J2SE</A><BR>
 <IMG
height=15 src="plus2.gif" width=15><A
href="http:">J2EE/EJB</A><BR> <IMG height=15
src="plus2.gif" width=15><A
href="http:">JSP</A><BR> <IMG
height=15 src="plus2.gif" width=15><A
href="http:"></A>J2ME<BR>
 <IMG
height=15 src="plus2.gif" width=15><A
href="http:">设计模式</A><BR>
 <IMG height=15
src="plus2.gif" width=15><A
href="http:">SUN JAVA</A><BR>
 <IMG height=15
src="plus2.gif" width=15><A
href="http:">非技术区</A></DIV>

<DIV class=parent id=KB1Parent><A
onclick="expandIt('KB1'); return false"
href="http://www.tqbooks.com/#"><IMG height=22
src="plus1.gif" width=20
border=0>DELGHI</A></DIV>
<DIV class=child id=KB1Child style="width: 110; height: 156"> <IMG height=15
src="plus2.gif" width=15><A
href="http:">基础类</A><BR>
 <IMG
height=15 src="plus2.gif" width=15><A
href="http:">非技术区</A><BR> <IMG height=15
src="plus2.gif" width=15><A
href="http:">DATABASE</A><BR>
 <IMG
height=15 src="plus2.gif" width=15><A
href="http:"></A>GAME<BR>
 <IMG
height=15 src="plus2.gif" width=15><A
href="http:">VCL</A><BR>
 <IMG height=15
src="plus2.gif" width=15><A
href="http:">网络编程</A><BR>
 <IMG height=15
src="plus2.gif" width=15><A
href="http:">图形处理</A>
</DIV>

</TD></tr>
</table>
</body>
</html>
柯嘉 2003-05-02
  • 打赏
  • 举报
回复
JTree能不能用在JSP或Servlet中?
sikuan 2003-04-30
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/1718/1718174.xml?temp=.7937738
sikuan 2003-04-30
  • 打赏
  • 举报
回复
JavaScript+xml
好象是

81,116

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧