Put the js inside the page first and test if it works. If it does then you know you've just got the wrong path to the file.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
activateMenu = function(nav) {
/* currentStyle restricts the Javascript to IE only */
if (document.all && document.getElementById(nav).currentStyle) {
var navroot = document.getElementById(nav);
/* Get all the list items within the menu */
var lis=navroot.getElementsByTagName("LI");
for (i=0; i<lis.length; i++) {
/* If the LI has another menu level */
if(lis[i].lastChild.tagName=="UL"){
/* assign the function to the LI */
lis[i].onmouseover=function() {
/* display the inner menu */
this.lastChild.style.display="block";
}
lis[i].onmouseout=function() {
this.lastChild.style.display="none";
}
}
}
}
}
window.onload= function(){
/* pass the function the id of the top level UL */
/* remove one, when only using one menu */
activateMenu('nav');
activateMenu('vertnav');
}
</script>
<style type="text/css">
#nav{list-style: none;}
#nav ul {
padding: 0;
margin:0;
list-style: none;
width:12em;
z-index:99;
position:relative;
overflow:visible;
}
#nav li {
margin:0;
position: relative;
float:left;
width: 12em;
background-color:#CCC;
border:solid 1px #666;
display:block;
height:auto;
}
#nav ul li{ border-width:1px 1px 0 0;margin-right:-1px}
#nav ul ul li{ border-width:1px 1px 1px 1px;}
#nav ul ul li:last-child{border-bottom:1px solid #666;}
#nav a {
text-decoration:none;
display:block;
padding: 0.1em;
margin:0.2em 0 0.2em 0.1em;
width:11.5em;
height:1em;
}
#nav a:hover, #nav li:hover{
background-color:#CCC;
}
#nav ul li:hover, #nav ul li a:hover{
background-color:#CCC;
}
#nav ul{
display:none;
}
/*all see this */
#nav ul ul{
display:none;
position:absolute;
margin-top:-1.8em;
margin-left:12em;
}
/* non-IE browsers see this */
#nav ul li>ul, #nav ul ul li>ul{
margin-top:-1.4em;
}
#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li:hover ul ul ul ul, #nav li:hover ul ul ul ul ul{
display:none;
}
#nav li:hover ul, #nav ul li:hover ul, #nav ul ul li:hover ul, #nav ul ul ul li:hover ul, #nav ul ul ul ul li:hover ul{
display:block;
}
li>ul {
top: auto;
left: auto;
}
</style>
</head>
<body>
<ul id="nav">
<li> <a href="#" >first Level menu</a>
<ul>
<li><a href="#">second Level menu</a></li>
<li><a href="#">second Level menu</a>
<ul>
<li><a href="#" >third Level menu</a></li>
</ul>
</li>
</ul>
</li>
<li> <a href="#" >next Level menu</a>
<ul>
<li><a href="#">next second Level menu</a></li>
<li><a href="#">next second Level menu</a>
<ul>
<li><a href="#">next third Level menu</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</body>
</html>
Bookmarks