关于ASP的SUB调用问题,代码如下:我想修改成子分类要用鼠标点击才能展开,默认是自动展开的!!!
SubShowSmallClass_Tree2()%><SCRIPTlanguage=javascript>functionopencat(cat,img){if(cat...
Sub ShowSmallClass_Tree2()
%>
<SCRIPT language=javascript>
function opencat(cat,img){
if(cat.style.display=="none"){
cat.style.display="";
img.src="img/class2.jpg";
} else {
cat.style.display="none";
img.src="img/class1.jpg";
}
}
</Script>
<TABLE cellSpacing=0 cellPadding=0 width="99%" border=0>
<%
dim i
set rsbig = server.CreateObject ("adodb.recordset")
sql="select * from bphoto"
rsbig.open sql,conn,1,1
if rsbig.eof and rsbig.bof then
Response.Write "栏目正在建设中……"
else
i=1
do while not rsbig.eof
%>
<TR>
<TD language=javascript onmouseup="opencat(cat10<%=i%>000, img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=34 height=24 align=center><IMG id=img10<%=i%>000 src="img/class1.jpg" width=13 height=13></TD>
<TD width="662" > <a href='photo.asp?BigClassName=<%=rsbig("BigClassName")%>'><FONT
color=#243d51><STRONG><%=rsbig("BigClassName")%></STRONG></FONT></A></a></TD>
</TR>
<TR>
<TD id=cat10<%=i%>000 <%if rsbig("BigClassName")=BigClassName then
response.write "style='DISPLAY'"
else
end if%> colspan="2">
<%
dim rsSmall,sqls,j
set rsSmall = server.CreateObject ("adodb.recordset")
sqls="select * from sphoto where BigClassName='" & rsbig("BigClassName") & "' order by SmallClassID"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
Response.Write ""
else
j=1
do while not rsSmall.eof
%>
<IMG height=20 src="img/class3.gif" width=26 align=absMiddle border=0> <a href="photo.asp?BigClassName=<%=rsSmall("BigClassName")%>&Smallclassname=<%=rsSmall("SmallClassName")%>"><FONT color=#243d51><%=rsSmall("SmallClassName")%></FONT></a><BR>
<%
rsSmall.movenext
j=j+1
loop
end if
rsSmall.close
set rsSmall=nothing
%>
</TD>
</TR>
<%
rsbig.movenext
i=i+1
loop
rsbig.close
set rsbig=nothing
end if
%>
</TABLE>
<%
end Sub 展开
%>
<SCRIPT language=javascript>
function opencat(cat,img){
if(cat.style.display=="none"){
cat.style.display="";
img.src="img/class2.jpg";
} else {
cat.style.display="none";
img.src="img/class1.jpg";
}
}
</Script>
<TABLE cellSpacing=0 cellPadding=0 width="99%" border=0>
<%
dim i
set rsbig = server.CreateObject ("adodb.recordset")
sql="select * from bphoto"
rsbig.open sql,conn,1,1
if rsbig.eof and rsbig.bof then
Response.Write "栏目正在建设中……"
else
i=1
do while not rsbig.eof
%>
<TR>
<TD language=javascript onmouseup="opencat(cat10<%=i%>000, img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=34 height=24 align=center><IMG id=img10<%=i%>000 src="img/class1.jpg" width=13 height=13></TD>
<TD width="662" > <a href='photo.asp?BigClassName=<%=rsbig("BigClassName")%>'><FONT
color=#243d51><STRONG><%=rsbig("BigClassName")%></STRONG></FONT></A></a></TD>
</TR>
<TR>
<TD id=cat10<%=i%>000 <%if rsbig("BigClassName")=BigClassName then
response.write "style='DISPLAY'"
else
end if%> colspan="2">
<%
dim rsSmall,sqls,j
set rsSmall = server.CreateObject ("adodb.recordset")
sqls="select * from sphoto where BigClassName='" & rsbig("BigClassName") & "' order by SmallClassID"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
Response.Write ""
else
j=1
do while not rsSmall.eof
%>
<IMG height=20 src="img/class3.gif" width=26 align=absMiddle border=0> <a href="photo.asp?BigClassName=<%=rsSmall("BigClassName")%>&Smallclassname=<%=rsSmall("SmallClassName")%>"><FONT color=#243d51><%=rsSmall("SmallClassName")%></FONT></a><BR>
<%
rsSmall.movenext
j=j+1
loop
end if
rsSmall.close
set rsSmall=nothing
%>
</TD>
</TR>
<%
rsbig.movenext
i=i+1
loop
rsbig.close
set rsbig=nothing
end if
%>
</TABLE>
<%
end Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询