tempest4000
01-19-2009, 03:52 PM
Hi,
I want to show a submenu when a link on the main menu has mouseover and then to hide when onmouseout. I have this working however, I want to be able to select from the submenu but obviously this is hidden when I move the cursor accross tot he submenu.
how do I keep this showing but then hide when the mouse is not on either the submenu or the relevant link?
function subMenu(show) {
if (show){
document.getElementById('sub_menu').style.display = 'block';
} else {
document.getElementById('sub_menu').style.display = 'none';
}
}
<divid="main_menu">
<a href="index.html">Home</a> |
<a href="main1.html" onmouseover="javascript:subMenu(true);" onmouseout="javascript:subMenu(false);">Blah</a> |
a href="main2.html">BlaH</a> |
</div>
<divid="sub_menu">
<a href="sub1.html">Roller</a> |
<a href="sub2.html">Pleated</a> |
</div>
Many thanks
I want to show a submenu when a link on the main menu has mouseover and then to hide when onmouseout. I have this working however, I want to be able to select from the submenu but obviously this is hidden when I move the cursor accross tot he submenu.
how do I keep this showing but then hide when the mouse is not on either the submenu or the relevant link?
function subMenu(show) {
if (show){
document.getElementById('sub_menu').style.display = 'block';
} else {
document.getElementById('sub_menu').style.display = 'none';
}
}
<divid="main_menu">
<a href="index.html">Home</a> |
<a href="main1.html" onmouseover="javascript:subMenu(true);" onmouseout="javascript:subMenu(false);">Blah</a> |
a href="main2.html">BlaH</a> |
</div>
<divid="sub_menu">
<a href="sub1.html">Roller</a> |
<a href="sub2.html">Pleated</a> |
</div>
Many thanks