Could someone see where I am in error with the following script?
I don’t get errors with FF or IE, but it doesn’t work either.
[code=php]
<html>
<head>
<title>Hide/Show Menu Attempt</title>
<script type=”text/javascript”>
function Show(menu) {
document.getElementById(menu).style.display=”;
}
function Hide(menu) {
document.getElementById(menu).style.display=’none’;
}
</script>
<style type=”text/css”>
.sh {
border:1px solid blue;
display:none;
}
</style>
</head>
<body>
<h1>Hide/Show Menu Attempt</h1>
Test – links to nowhere<br>
<br>
<a href=”#” onMouseover=”Show(‘nsumenu’)”>NSU</a>
<div class=’sh’ id=’nsumenu’><!– onBlur=”Hide(‘nsumenu’)” test later –>
<ul>
<li><a href=”#” onClick=”alert(‘NSU’)”>NSU</a></li>
<li><a href=”#” onClick=”alert(‘Optometry’)”>Optometry</a></li>
</ul>
</div>
<br>
<a href=”#” onMouseover=”Show(‘optmenu’)”>Optometry</a>
<div class=’sh’ id=’optmenu’><!– onBlur=”Hide(‘optmenu’)” –>
<ul>
<li><a href=”#” onClick=”alert(‘Clinic’)”>Clinic</a></li>
<li><a href=”#” onClick=”alert(‘Faculty’)”>Faculty</a></li>
<li><a href=”#” onClick=”alert(‘Students’)”>Students</a></li>
<li><a href=”#” onClick=”alert(‘Staff’)”>Staff</a></li>
</ul>
</div>
<br>
<a href=”#” onMouseover=”Show(‘otmmenu’)”>OTM</a>
<div class=’sh’ id=’otmmenu’><!– onBlur=”Hide(‘otmmenu’)” –>
<ul>
<li><a href=”#” onClick=”alert(‘OTM-1’)”>OTM-1</a></li>
<li><a href=”#” onClick=”alert(‘OTM-2’)”>OTM-2</a></li>
<li><a href=”#” onClick=”alert(‘OTM-3’)”>OTM-3</a></li>
<li><a href=”#” onClick=”alert(‘OTM-4’)”>OTM-4</a></li>
</ul>
</div>
</body>
</html>
The attempt is to have hidden <div> until mouse rolls over the initial link.
Later, if I can get the first part to work, I’ll use the onBlur() or onMouseout() to re-hide the display.
Currently, links are non-functional with the alerts set-up to see if concept would work.
Thanks for any replies.