求助:怎么样制作树型菜单?

threezxw 2004-04-06 03:50:38
怎么样制作一个象下面网页所示的样式的菜单呢?
http://www.1studio.net/html/example/0060/0060.htm#
它制作的菜单前面由加号,菜单站开时父项和子项之间有虚线链接。而我
安他说的制作的既没有加号也没有虚线。为什么?怎么解决?最好给一个源码?
多谢各位大侠!!
...全文
91 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
joe820302 2004-04-09
  • 打赏
  • 举报
回复
阿信可是元老级的人物了吧 :)
koma5130 2004-04-09
  • 打赏
  • 举报
回复
真是个好网站啊!
joe820302 2004-04-09
  • 打赏
  • 举报
回复
演示:http://joe.2418.com/programme/html/list2/list2.htm
代码:http://joe.2418.com/programme/html/list2.rar
threezxw 2004-04-09
  • 打赏
  • 举报
回复
谁能给个又源码的例子。多谢了。
joe820302 2004-04-08
  • 打赏
  • 举报
回复
没有阿信做的那么好。
http://joe.2418.com/programme/html/list2/list2.htm
虽然也支持XML定义,不过我本地用的是JAVA环境,这个是IIS。大家凑合凑合吧 :)
nameldw 2004-04-08
  • 打赏
  • 举报
回复
http://fason.nease.net/
mengshi 2004-04-08
  • 打赏
  • 举报
回复
我把这两个图片下载下来,然后把你的代码运行了一下,在我机器上没问题!
threezxw 2004-04-08
  • 打赏
  • 举报
回复
怎样才能做个好的呢
有没有源代码?
给个好吗
谢谢
pingzi3000 2004-04-07
  • 打赏
  • 举报
回复
这个树型菜单差了点,最末子结点没有闭合功能,无限制层次的功能也很受限!
threezxw 2004-04-06
  • 打赏
  • 举报
回复
图片我已经存了,
呵呵,这个常识我还是有的了。
图片正常显示,就是没有加号和虚线
风流才子 2004-04-06
  • 打赏
  • 举报
回复
我快吐血了,不把图片存过来哪来的图片plus.gif,blank.gif
threezxw 2004-04-06
  • 打赏
  • 举报
回复
我安他的步骤和代码制作的网页如下:
<html>
<head>
<script language=JavaScript1.2>
scores = new Array(20);
var numTotal=0;
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) {
whichEl1 = eval(el + "Child");
for(i=1;i<=numTotal;i++){
whichEl = eval(scores[i] + "Child");
if(whichEl!=whichEl1) {
whichEl.style.display = "none";
}
}
whichEl1 = eval(el + "Child");
if (whichEl1.style.display == "none") {
whichEl1.style.display = "block";
}
else {
whichEl1.style.display = "none";
}
}
else {
whichEl = eval("document." + el + "Child");
for(i=1;i<=numTotal;i++){
whichEl = eval("document." + scores[i] + "Child");
if(whichEl!=whichEl1) {
whichEl.visibility = "hide";
}
}
if (whichEl.visibility == "hide") {
whichEl.visibility = "show";
}
else {
whichEl.visibility = "hide";
}
arrange();
}
}
onload = initIt;
</script>
</head>
<body bgcolor=c2c2c2>
<div id=KB1Parent>
<a onClick="expandIt('KB1');return false" href="#"><img src="plus.gif" border=0>精品下载

</a>
</div>
<div class=child id=KB1Child>
<a href="#"><img src="blank.gif" border=0>Dreamweaver 资源</a><br>
<a href="#"><img src="blank.gif" border=0>Fireworks 资源</a><br>
<a href="#"><img src="blank.gif" border=0>Flash 资源</a><br>
<a href="#"><img src="blank.gif" border=0>Photoshop 资源</a>
</div>
<div id=KB2Parent>
<a onClick="expandIt('KB2');return false" href="#"><img src="plus.gif" border=0>免费申请

</a>
</div>
<div class=child id=KB2Child>
<a href="#"><img src="blank.gif" border=0>免费计数器申请</a><br>
<a href="#"><img src="blank.gif" border=0>免费留言板申请</a><br>
<a href="#"><img src="blank.gif" border=0>免费网上调查申请</a></div>
<div id=KB3Parent>
<a onClick="expandIt('KB3');return false" href="#"><img src="plus.gif" border=0>酷站源码

</a>
</div>
<div class=child id=KB3Child>
<a href="#"><img src="blank.gif" border=0>脚本收集</a><br>
<a href="#"><img src="blank.gif" border=0>HTML特效</a><br>
<a href="#"><img src="blank.gif" border=0>ASP源程序下载</a><br>
<a href="#"><img src="blank.gif" border=0>XML方面</a><br>
</div>
<script>numTotal=3;scores[1]='KB1';scores[2]='KB2';scores[3]='KB3';</script>

</body>
</html>

87,922

社区成员

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

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