说唱歌词押韵爱情:如何把目录默认为展开 ShowSmallClass_Tree

来源:百度文库 编辑:高考问答 时间:2024/04/16 21:12:20
如何修改成,默认是展开的,而不用鼠标点击展开。

过程名:ShowSmallClass_Tree
'作 用:树形目录方式显示栏目
'参 数:无
'=================================================
Sub ShowSmallClass_Tree()
%>
<SCRIPT language=javascript>
function opencat(cat,img){
if(cat.style.display=="none"){
cat.style.display="";
img.src="img/class2.gif";
} else {
cat.style.display="none";
img.src="img/class1.gif";
}
}
</Script>
<TABLE cellSpacing=0 cellPadding=0 width="99%" border=0>
<%
dim i
if rsBigClass.eof and rsBigClass.bof then
Response.Write "栏目正在建设中……"
else
i=1
do while not rsBigClass.eof
%>
<TR>
<TD language=javascript onmouseup="opencat(cat10<%=i%>000, img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=32 height=24 align=center><IMG id=img10<%=i%>000 src="img/class1.gif" width=20 height=20></TD>
<TD width="162"><a href='Product.asp?BigClassName=<%=rsBigClass("BigClassName")%>'><%=rsBigClass("BigClassName")%></a></TD>
</TR>
<TR>
<% if BigClassName<>rsBigClass("BigClassName") then %>
<TD id=cat10<%=i%>000 style="DISPLAY: none" colspan="2">
<% else %>
<TD id=cat10<%=i%>000 style="DISPLAY" colspan="2">
<% end if %>
<%
dim rss,sqls,j
set rss = server.CreateObject ("adodb.recordset")
sqls="select * from SmallClass where BigClassName='" & rsBigClass("BigClassName") & "' order by SmallClassID"
rss.open sqls,conn,1,1
if rss.eof and rss.bof then
Response.Write "没有小分类"
else
j=1
do while not rss.eof
%>
 <IMG height=20 src="img/class3.gif" width=26 align=absMiddle border=0><a href="Product.asp?BigClassName=<%=rss("BigClassName")%>&Smallclassname=<%=rss("SmallClassName")%>"><%=rss("SmallClassName")%></a><BR>
<%
rss.movenext
j=j+1
loop
end if
rss.close
set rss=nothing
%>
</TD>
</TR>
<%
rsBigClass.movenext
i=i+1
loop
end if
%>
</TABLE>
<%
end Sub
前台调用 是 <% call ShowSmallClass_Tree() %>

请大家帮忙看看,谢谢。

把所有DISPLAY: none改成DISPLAY试试,也就是说不加:none。