I have a css navigation menu that I need to display over a select box, and currently it displays under it. I know this is a pretty common problem with select boxes, but I've always been able to hide it with JavaScript. My code below works great when I have just one select box named 'States'. But now, I have two select boxes, one named 'States' and one named 'Type' and I can't get the second box to disappear when someone mouses over the menu.
I know virtually nothing about JavaScript, I was able to muddle through it and get it working the first time, but I don't have a clue how to add the second select box. Can someone show me how?
Hope This Helps!
ECAR
ECAR Technologies
"My work is a game, a very serious game." - M.C. Escher
Code:
<script language="JavaScript" type="text/javascript">
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
document.getElementById('State').style.visibility='hidden';}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
document.getElementById('State').style.visibility='';}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
function no_error()
{ return true; }
window.onerror=no_error;
</script>
Hope This Helps!
ECAR
ECAR Technologies
"My work is a game, a very serious game." - M.C. Escher