谁手里有阿信的下拉菜单代码?不是树形的。100分送上。

tatty_bad 2005-11-30 10:57:46
谁手里有的?请给我一个下载地址。。。
我100分送上。。。

是阿信的无限级下拉菜单,XML实现的。。

不是树形的菜单
...全文
254 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
hreoghost 2005-12-08
  • 打赏
  • 举报
回复
mark
tatty_bad 2005-11-30
  • 打赏
  • 举报
回复
不是吧?没有人有??
阿信的网站打不开。5555。
tatty_bad 2005-11-30
  • 打赏
  • 举报
回复
没有人手里有???
郁闷Ing
tatty_bad 2005-11-30
  • 打赏
  • 举报
回复
唉,谢谢了.

你说我要你复制这些代码来干什么呢?
我已经看过,不是这些,而且我也说明了,不是树形的,是联动的那种,要求是无刷新XML实现..

竹林听雨2005 2005-11-30
  • 打赏
  • 举报
回复
还有一种:


<%
ConnectDB()
Set rs=Server.CreateObject ("ADODB.Recordset")
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>left</title>
<base target="main">
<STYLE type=text/css>
A:visited {
TEXT-DECORATION: none
}
.child { font-size: 9pt; font-family: 宋体 }
A:link {
TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: underline
}

</STYLE>
<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;
imgopen=new Image();
imgclose=new Image();
imgopen.src="images/icon_folder_open.gif";
imgclose.src="images/icon_folder_unlock.gif";
imgtoclose='';

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>
<script language="javascript">

function changeimg(imgname){
if(imgtoclose!='')
{
document.images[imgtoclose].src=imgclose.src;
}
document.images[imgname].src=imgopen.src;
imgtoclose=imgname;
//alert(imgname);
}
</script>


</head>

<body link="#384C88" background="images/bg.gif" vlink="#384C88" alink="#384C88" leftmargin="1">
<table border="0" width="107%" cellspacing="0" cellpadding="0" height="184">
<tr>
<td width="100%" align="center" height="19">
<font size="2" color="#4993DC"><a style="color: #4993DC" href="right.asp">论坛首页</a></font></td>
</tr>
<tr>
<td width="100%" align="center" height="19">
<font size="2" color="#4993DC"><a style="color: #4993DC" href="admin/default.htm" target="_parent">管理员入口</a></font></td>
</tr>
<tr>
<td width="100%" align="center" height="19">
<font size="2" color="#4993DC"><a style="color: #4993DC" href="managers/index.asp" target="_blank">版主入口</a></font></td>
</tr>
<tr>
<td width="100%" height="21">
<hr color="#000000">
</td>
</tr>
<tr>
<td width="100%" height="93" valign="top">
<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#787E94">
<tr>
<td width="6%" bgcolor="#787E94"> </td>
<td width="94%" bgcolor="#E8E8E8">
<table border="0" width="100%" height="59">
<tr>
<td width="100%" height="16">
<%
set rst=server.CreateObject("adodb.recordset")
rst.open "Select id from tablename where parentid = 0"
fcount=0
while not rst.EOF
fcount=fcount+1
aid="KB"&fcount&"Parent"
%>
<div id="<%=aid%>" class="parent"> <img border="0" src="images/ball-gray.gif" align="absmiddle"><a href="#" onClick="expandIt('KB1'); return false" class="h1">
<font size="2"> <%=aid%></font></a> </div>

<div id="KB1Child" class="child">
<%
set rst1=server.CreateObject("adodb.recordset")
strSql="SELECT * FROM tablname WHERE parentid="&rst("id")
rst1.open strSql ,conn

if rst1.Eof and rst1.Bof then
%>
   暂无讨论区
<%
else

do until rst1.eof
%>
  <img border="0" name="image_folder_<%=trim(rst("id"))%>" src="images/icon_folder_unlock.gif"> <a href="arclist.asp?nPage=1&strDBName=<%=trim(rst1("id"))%>&fname=<%=trim(rst1("id"))%>" target="main" onclick="changeimg('image_folder_<%=trim(rst1("id"))%>')"><%=trim(rst1("name"))%></a><br>


<%
rst1.movenext
loop

End If
rst1.close
%>

</div>
<%
rst.MoveNext
wend%>
</table>
</table>
</body>

<%
rst.Close
set rst=nothing
conn.close
set conn=nothing
%>
<!-- #include file="adovbs.inc" -->



改一下sql
竹林听雨2005 2005-11-30
  • 打赏
  • 举报
回复
无限级分类(ASP):比较简单的一个页面,类似csdn论坛在ns下的左边列表
描述:

1.

数据名:tree.mdb

表名:tree

表结构:id(自编) pid(数字) content(文本) link(文本)

2.

图片:endnode.gif collapsed.gif back.gif(均在img目录下,可自行修改)

3.

代码:

<!--#include file="conn.inc"-->
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<TITLE>无限级列表</TITLE>
<!--
by fason(2003-5-12)
-->
<style>
.node{
font-size:12px;
padding:0 0 2 0;
margin-left:10;
height:22px;
}
img{
vertical-align:middle;
width:11px;
height:11px;
}
a{text-decoration:none;font-size:12px;color:black}
.deeptree{
width:100%;
height:100%;
backgound-color:#f2f2f2;
overflow:auto;
}

</style>
</HEAD>
<BODY bgcolor=#f2f2f2>
<nobr>
<div class="deeptree">
<%
newid=Request.QueryString("id")
if newid="" or CInt(newid)<0 then newid=0
if isNumeric(newid) then
listTree(CInt(newid))
end if

function listTree(id)
dim rs
dim imgFolder,imgFile
dim link,href,parentHref
dim target,ahref,click
target="main" '所指定的框架名
imgFolder="img/" '默认路径
set rs=conn.execute("select *,(select count(*) from tree where pid = T.id) as children,(select pid from tree where id="&id&") as parent from tree T where pid="&id)
if not rs.eof then
parentHref=Request.ServerVariables("URL")&"?id="&rs("parent")
if id<>0 then Response.Write "<div class='node' nowrap=true><a href='"&parentHref&"' onfocus='blur()'><img src='"&imgFolder&"back.gif' border=0></a> <a href='"&parentHref&"'>上一级目录</a></div>"&VbCrLf
do while not rs.eof
if rs("children")>0 then
img=imgFolder+"collapsed.gif"
href=Request.ServerVariables("URL")&"?id="&rs("id")
click="onclick=""location.href='"&href&"'"""
else
img=imgFolder+"endnode.gif"
href="javascript:void(0)"
end if
if not isNull(rs("link")) then
ahref=rs("link")
else
ahref="javascript:void(0)"
target="_self"
end if
link="<a href='"&ahref&"' target='"&target&"' title='"&rs("content")&"' "&click&">"&rs("content")&"</a>"
Response.Write "<div class='node' nowrap=true><a href='"&href&"' onfocus='blur()'><img src='"&img&"' border=0></a> "&link&"</div>"
rs.movenext
loop
rs.close:set rs=nothing
end if
end function
conn.close:set conn=nothing
%>

</div>
</nobr>
</BODY>
</HTML>


conn.inc:

<%
dim conn
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.mappath("tree.mdb") & ";Persist Security Info=False"
%>

4.测试:ie6,ns7,mozilla下测试通过

原理比较简单,有错请大家指正,谢谢



tatty_bad 2005-11-30
  • 打赏
  • 举报
回复
上面两位朋友的不对。。。
不是哟
gatey 2005-11-30
  • 打赏
  • 举报
回复
顶一下
竹林听雨2005 2005-11-30
  • 打赏
  • 举报
回复
http://www.laikan8.com/21/118529.html

用的是阿信的XML+JS无限下拉菜单改的!
zalvsa 2005-11-30
  • 打赏
  • 举报
回复
http://51js.zahui.net/html/1/24666.htm
这个看看

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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