I have solved this one myself recently but it depends very much on your situation. I will give you the following pointers:
1)
No JavaScript is requiredEdit: Having had a look at demo, the fading requires javascript, the basic concept of a vertical menu that displays items below it does not (and same for horizontal menu).
2) Look at the following CSS selector:
http://www.w3schools.com/css/sel_element_gt.asp[
^] - It will allow you to create an invisible wrapper for your menu with one item showing that then lets the user hover over it and then the rest of the items appear. CSS something like:
.MenuWrapper
{
}
.MenuItem
{
display:none;
}
.MenuWrapper:hover>MenuItem
{
display:inherit;
}
Hope this helps,
Ed :)
P.s. If I can find it, I will post my CSS/HTML soon :)
My code that I used recently:
<div class="MenuItemWrapper">
<a class="MenuItem" href="?Page=Home">
Home</a>
<div class="MenuItemSubLinksWrapper" runat="server" id="HomeSubLinks">
<div class="MenuItemSubLinkSeperator"></div>
<a class="MenuItemSubLink" href="?Page=Latest News">
Latest News</a>
<div class="MenuItemSubLinkSeperator"></div>
</div>
</div>
<div class="MenuItemWrapper" runat="server" id="LoginLinks">
<a class="MenuItem" href="?Page=Login">
Sign In</a>
</div>
<div class="MenuItemWrapper" runat="server" id="AccountLinks" visible="false">
<a class="MenuItem" href="?Page=My Account">
My Account</a>
<div class="MenuItemSubLinksWrapper" runat="server" id="Div1">
<div class="MenuItemSubLinkSeperator"></div>
<a class="MenuItemSubLink" href="?Page=Logout">
Sign Out</a>
<div class="MenuItemSubLinkSeperator"></div>
</div>
</div>
<div class="MenuItemWrapper" runat="server" id="SignUpLinks">
<a class="MenuItem" href="?Page=Sign Up">
Sign Up</a>
</div>
</div>
.MenuItemWrapper
{
position:relative;
min-width:120px;
width:5%;
max-width:150px;
float:left;
margin-left:0px;
height:100%;
text-align:center;
border-left:#F1F1F1 1px solid;
border-right:#F1F1F1 1px solid;
z-index:5;
}
.MenuItemWrapper:hover
{
}
.MenuItem
{
position:relative;
background-color:Transparent;
z-index:2;
font-size:large;
top:5px;
color:#FFFFFF;
text-align:center;
z-index:inherit;
}
.MenuItem:hover
{
font-weight:bold;
color:#CCCCCC;
}
.MenuItemWrapper:hover>div
{
display:block;
}
.MenuItemSubLinksWrapper
{
position:absolute;
font-size:medium;
min-height:100%;
min-width:100%;
display:none;
z-index:1;
background-color:#f1f1f1;
border:solid 1px #000000;
left:0px;
top:30px;
z-index:inherit;
}
.MenuItemSubLinkSeperator
{
line-height:10px;
font-size:10px;
height:10px;
}
.MenuItemSubLink
{
position:relative;
padding-left:5px;
padding-right:5px;
padding-top:0px;
padding-bottom:3px;
width:100%;
color:#06334F;
z-index:inherit;
}
.MenuItemSubLink:hover
{
font-weight:bold;
color:#0C141A;
}
You will need, probably, to fiddle with the styling on the MenuItemWrapper class to get correct widths and positioning for your menu/menu items. Also, for varying font-sizes, remember to change the 'top:30px;' value in MenuItemSubLinksWrapper. This menu style will only go one level deep.