<html>
<head>
<title>Вертикальное меню</title>
<style>
#mainMenu {
width: 150px;
height: 300px;
background-color: #DDDDDD;
float: left;
margin-right: 20px;
}
#mainMenu a, .menu a {
display: block;
width: 100%;
text-decoration: none;
font-family: Arial;
font-size: 9pt;
font-weight: bold;
color: black;
margin: 2px;
padding: 3px;
border: #DDDDDD 1px solid;
}
#mainMenu a:hover, .menu a:hover {
border: #999999 1px solid;
}
.menu {
position: absolute;
width: 150px;
height: 40px;
background-color: #DDDDDD;
left: 170px;
border: #999999 1px solid;
visibility: hidden;
}
</style>
<script language="JavaScript">
var timers = new Array();
function mainMenuMouseOver(subMenuID) {
var subMenu = document.getElementById(subMenuID);
subMenu.style.visibility = "visible";
var menuItem = event.srcElement;
subMenu.style.top = menuItem.offsetTop +
menuItem.parentElement.offsetTop;
}
function mainMenuMouseOut(subMenuID) {
timers[subMenuID] = setTimeout("hideMenu('" + subMenuID + "')", 100);
}
function hideMenu(subMenuID) {
var subMenu = document.getElementById(subMenuID);
subMenu.style.visibility = "";
}
function subMenuMouseOver(objSubMenu) {
clearTimeout(timers[objSubMenu.id]);
}
function subMenuMouseOut(objSubMenu) {
timers[objSubMenu.id] =
setTimeout("hideMenu('" +
objSubMenu.id + "')", 100);
}
</script>
</head>
<body>
<table>
<tr>
<td>
<div id="mainMenu">
<a href="#" onmouseover="mainMenuMouseOver('m1')" onmouseout="mainMenuMouseOut('m1')">1111</a>
<a href="#" onmouseover="mainMenuMouseOver('m2')" onmouseout="mainMenuMouseOut('m2')">2222</a>
<a href="#" onmouseover="mainMenuMouseOver('m3')" onmouseout="mainMenuMouseOut('m3')">3333</a>
</div>
<div id="m1" class="menu" onmouseover="subMenuMouseOver(this)" onmouseout="subMenuMouseOut(this)">
<a href="1.html">1</a>
<a href="2.html">2</a>
</div>
<div id="m2" class="menu" onmouseover="subMenuMouseOver(this)" onmouseout="subMenuMouseOut(this)">
<a href="1.html">1</a>
<a href="2.html">2</a>
<a href="3.html">3</a>
</div>
<div id="m3" class="menu" onmouseover="subMenuMouseOver(this)" onmouseout="subMenuMouseOut(this)">
<a href="1.html">1</a>
<a href="2.html">2</a>
<a href="3.html">3</a>
<a href="4.html">4</a>
</div>
</td>
</tr>
</table>
</body>
</html>