Jump to content

active state in menu


jschoice2002

Recommended Posts

Can someone pleaaaase help me.... Im trying to define an active state for a menu which contains items that can be added. The site has an page parameter and a sub parameter in which sub stands for the submenu. i have no idea how i can define the active state of the css class though.<div align="left"><br><ul id="menu"><%If Page = 2 Then Do until rsSubsmenu.EOFResponse.Write("<LI><a href=index.asp?page=2⊂="&(rsSubsmenu.Fields.Item("subItemno").Value)&">"&(rsSubsmenu.Fields.Item("subItemHead").Value)&"</A><BR></LI>")rsSubsmenu.Movenext()LoopEnd If%></ul></div></td> CSS#menu ul{ color:#4c4c4c; background-color:transparent; text-decoration:none; font-family: Georgia, "Times New Roman", Times, serif; font-size: 12px; line-height: 20px; list-style-type: circle; list-style-position: inside; }#menu ul li{ color:#4c4c4c; background-color:transparent; text-decoration:none; font-family: Georgia, "Times New Roman", Times, serif; font-size: 12px; line-height: 20px; list-style-type: circle; list-style-position: inside; }#menu ul li.active{ color:#4c4c4c; background-color:transparent; text-decoration:none; font-family: Georgia, "Times New Roman", Times, serif; font-size: 12px; line-height: 20px; list-style-type: circle; list-style-position: inside; } #menu ul li:hover{ color:#E2007A; background-color:transparent; text-decoration:none; font-family: Georgia, "Times New Roman", Times, serif; font-size: 16px; line-height: 20px; list-style-position: outside; list-style-type: circle; background: transparent url(images/subnav-arrow.jpg); margin-right:10px; background-repeat:no-repeat; background-position:right; padding-right:35px; }

Link to comment
Share on other sites

you would loop through each li if page = 2 add class="active" else produce normal liIf Page = 2 Then Response.Write("<LI><a class='active' href=index.asp?page=2⊂="&(rsSubsmenu.Fields.Item("subItemno").Value)&">"&(rsSubsmenu.Fields.Item("subItemHead").Value)&"</A><BR></LI>")ElseResponse.Write("<LI><a href=index.asp?page=2⊂="&(rsSubsmenu.Fields.Item("subItemno").Value)&">"&(rsSubsmenu.Fields.Item("subItemHead").Value)&"</A><BR></LI>")End If

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...