JS Dynamic Cascade Level 2 menu

Source: Internet
Author: User

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
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.