I am creating a menu and submenu (vertical tree) using scripts like this with classnames and ids:
These scripts are repeated for each menu item.
I then use mouseover and mouseout to launch the scripts. Everything works fine.
PROBLEM:
I can't hide the last submenu selected. Once the user moves away from the menu, the last submenu moused over stays open.
I tried to use the Hide subcategories script on the parent DIV tag (ie, when the user mousesout of the parent div tag) but for some reason the cursor can see the parent div tag when floating between the children (submenu) div tags and so it no longer allows for the submenu to become visible.
Any ideas how to reset all elements to same values as when page loads?
Code:
/* Shows subcategories */
function ShowSubcatories1(maincat1) {
document.getElementById('subcat1').style.display = "block";
}
/* Hides subcategories */
function HideSubcategories1(maincat1) {
document.getElementById('subcat1').style.display = "none";
}
These scripts are repeated for each menu item.
I then use mouseover and mouseout to launch the scripts. Everything works fine.
PROBLEM:
I can't hide the last submenu selected. Once the user moves away from the menu, the last submenu moused over stays open.
I tried to use the Hide subcategories script on the parent DIV tag (ie, when the user mousesout of the parent div tag) but for some reason the cursor can see the parent div tag when floating between the children (submenu) div tags and so it no longer allows for the submenu to become visible.
Any ideas how to reset all elements to same values as when page loads?