Just now, I made a JS menu effect for xiaogao to Dynamically Retrieve data. I made it and recorded it for later use.
<SCRIPT>
Function showsubmenu (SID)
{
Whichel = eval ("submenu" + Sid );
Imgmenu = eval ("imgmenu" + Sid );
If (whichel. style. Display = "NONE ")
{
Eval ("submenu" + Sid + ". style. Display = /"/";");
Imgmenu. Background = "nimages/admin_2.gif ";
}
Else
{
Eval ("submenu" + Sid + ". style. Display =/" NONE /";");
Imgmenu. Background = "nimages/admin_1.gif ";
}
}
Function loadingmenu (ID ){
VaR loadmenu = eval ("menu" + id );
If (loadmenu. innertext = "loading ..."){
Document. Frames ["hiddenframe"]. Location. Replace ("lefttree. asp? Menu = menu & id = "+ ID + "");
}
}
</SCRIPT>
<%
Set rs = server. Createobject ("ADODB. recordset ")
Rs. Open "select * From xr_anclass order by anclassidorder", Conn, 1, 1
If Rs. recordcount = 0 then
Response. Write "<br> NO product category currently"
Else
I = 1
Do while not Rs. EOF
%>
<Table border = "0" width = "158" cellspacing = "0" cellpadding = "0">
<Tr id = "imgmenu <% = I %>" onclick = "showsubmenu (<% = I %>)" style = "cursor: Hand" class = "menul">
<TD width = "20" Height = "28" align = "center"> </TD>
<TD width = "160"> <% = RS ("anclass") %> </TD>
</Tr>
<Tr>
<TD Height = "1" colspan = "2" background = "images/left_bg2.gif"> </TD>
</Tr>
<Tr>
<TD id = "submenu <% = I %>" colspan = "2" style = "display: none">
<Table border = "0" width = "100%" cellspacing = "0" cellpadding = "0" Height = "18">
<Tr>
<TD class = "table00 <% = I %>" Height = "23">
<Table border = "0" width = "100%" cellspacing = "0" cellpadding = "0" Height = "23">
<%
Set R1 = server. Createobject ("ADODB. recordset ")
R1.open "select * From xr_nclass where anclassid =" & RS ("anclassid"), Conn, 1, 1
If r1.recordcount = 0 then
%>
<Tr>
<TD> </TD>
</Tr>
<%
Else
Do while not r1.eof
%>
<Tr>
<TD Height = "23"> & nbsp;
☉<A href = 'shoplist. asp? Lx = Small & anid = <% = RS ("anclassid") %> & nid = <% = R1 ("nclassid ") %> '> <% = R1 ("nclass") %> </a> </TD>
</Tr>
<%
R1.movenext
If r1.eof then exit do
Loop
End if
R1.close
Set R1 = nothing
%>
</Table>
</TD>
</Tr>
</Table>
</TD>
</Tr>
</Table>
<%
Rs. movenext
I = I + 1
If Rs. EOF then exit do
Loop
End if
Rs. Close
Set rs = nothing
%>