Okay. I have a short implentation of it:
http://mburt.mb.funpic.org/test/cnn_menu.htm
The only difference is that it doesn't delay the onmouseout feature.
Save the following as "menu.js"
Code:
function showmenu(orig,elem) {
var obj = document.getElementById(elem)
var padding = 1
if (navigator.appName == "Netscape") {
padding = -5
}
obj.style.display = "block"
obj.style.left = orig.offsetLeft
obj.style.top = orig.offsetTop + orig.offsetHeight - padding
obj.onmouseover = function() {
obj.style.display = "block"
}
obj.onmouseout = function(e) {
var ev = event || e
document.onmousemove = function() {
if (ev.clientY > (obj.offsetTop + obj.offsetHeight) + 50) {
obj.style.display = "none"
}
if (ev.clientX < obj.offsetLeft || ev.clientX > (obj.offsetLeft + obj.offsetWidth)) {
obj.style.display = "none"
}
}
}
orig.onmouseout = function() {
obj.style.display = "none"
}
}
This will be your HTML document
Code:
<html>
<head>
<style type="text/css">
.menuheader {
display:inline;
margin:0px
}
.menuheader a {
padding:7px;
border:1px solid rgb(73,148,205);
font:10px arial;
font-weight:bold;
color:white;
text-decoration:none;
background:url('gradient.png')
}
.menu {
border:1px solid rgb(73,148,205);
background:rgb(238,238,238);
width:177px;
position:absolute;
display:none
}
.menu a {
color:rgb(52,102,153);
text-decoration:none;
display:block;
font:12px arial;
padding-left:4px;
padding-right:4px;
padding-top:2px;
padding-bottom:2px
}
.menu a:hover {
background:rgb(52,102,153);
color:white
}
</style>
<script type="text/javascript" src="menu.js"></script>
</head>
<body>
<div class="menuheader" onmouseover="showmenu(this,'news')">
<a href="#">NEWS</a>
</div>
<div class="menu" id="news">
<a href="#">Main</a>
<a href="#">Companies</a>
<a href="#">Economies</a>
<a href="#">World Business</a>
<a href="#">News Makers</a>
<a href="#">Fun Money</a>
<a href="#">Corrections</a>
</div>
<div class="menuheader" onmouseover="showmenu(this,'news2')">
<a href="#">NEWS 2</a>
</div>
<div class="menu" id="news2">
<a href="#">Main</a>
<a href="#">Companies</a>
<a href="#">Economies</a>
<a href="#">World Business</a>
<a href="#">News Makers</a>
<a href="#">Fun Money</a>
<a href="#">Corrections</a>
</div>
</body>
</html>
Make a division for the header:
Code:
<div class="menuheader" onmouseover="showmenu(this,'newmenu')">BLAH</div>
The second parameter is the menu's id. Make the menu using a div again, and give it links:
Code:
<div class="menu" id="newmenu">
<a href="#">Site 1</a>
<a href="#">Site 2</a>
<a href="#">Etc.</a>
</div>
You have to save this image:
http://mburt.mb.funpic.org/test/gradient.png
Bookmarks