Sub Menu question
Hi, everybody! I want to create a row of menus, and the effect I want is that sub menu will appear just beside the menu after the mouse cursor is pointed over to one of the menu button.
For example, when go to www.dev-archive.com, at the left side, there is the dev-archive Navigation menu. If we point our cursor over one of the menu, such as Visual C++/C++, sub menu is displayed. I want to program this kind of effect, can any one help me on this?
[459 byte] By [
hlchuah77] at [2007-11-19 1:37:22]

# 1 Re: Sub Menu question
copy the code below and see the effect...maybe this is what ur looking for.
<style>
ul
{
display=block;
font-family=verdana;
font-size=10px;
list-style=none;
width=100px;
border-bottom:1px solid gray;
cursor:hand;
}
ul li
{
position=relative;
border:1px solid gray;
border-bottom:0;
}
li ul
{
display=none;
list-style=none;
position=absolute;
left:58px;
top:0;
}
font
{
font-family:verdana;
font-size:10px;
}
</style>
<script language=javascript>
function ovr(itm)
{
for (i=0;i<itm.childNodes.length;i++)
{
if (itm.childNodes[i].nodeName == 'UL')
{
itm.childNodes[i].style.display='block';
}
}
}
function out(itm)
{
for (i=0;i<itm.childNodes.length;i++)
{
if (itm.childNodes[i].nodeName == 'UL')
{
itm.childNodes[i].style.display='none';
}
}
}
</script>
<BODY >
<div style="filter:progid:DXImageTransform.Microsoft.DropShadow(1);border:1">
<UL >
<LI onmouseover="ovr(this);" onmouseout="out(this);"> First
<UL >
<LI onmouseover="ovr(this);" onmouseout="out(this);">Sub-menu1
<UL >
<LI >Sub-menu1</li>
<LI> Sub-menu2</li>
<LI> Sub-menu3</li>
<LI> Sub-menu4</li>
</UL>
</li>
<LI> Sub-menu2</li>
<LI> Sub-menu3</li>
<LI> Sub-menu4</li>
</UL>
</li>
<LI onmouseover="ovr(this);" onmouseout="out(this);"> Second
<UL >
<LI >Sub-menu1</li>
<LI> Sub-menu2</li>
<LI> Sub-menu3</li>
<LI> Sub-menu4</li>
</UL>
</li>
<LI> Third</li>
<LI> Fourth</li>
</UL>
</div>
this code is not my creation ...but i picked it off some site...dont remember which one :)
# 2 Re: Sub Menu question
If you are using Visual Basic it is quite simple.
Construct a normal menu bar for the program. Once you execute the program you can scroll along the main mneu with the left mouse button depressed and the various sub meenues appear in turn.
# 3 Re: Sub Menu question
Wow, thanks and thanks a lot to you, PallaviDalvi. This is the thing that I want. Thank you so much. It's ok if it is not your coding, I just want to have some reference for building my web page.
Thanks too to nieukei. Anyhow, I have no idea on how to use Visual Basic, perhaps I already forget about it since my last use of Basic was two years back. But, you mean VB or VB.net?