Ok, so I'm trying to get some cool drop-down menus to work here. They work just great in Firefox, but as usual, IE craps out due to it not supporting the :hover property on all elements.
So I use a workaround JavaScript, shown below. It parses through the child elements of the specified element ID (in this case, the "navigation" element), checking to see if they are LI elements. If they are, when the user mouses over one of these elements, the script adds the "over" class to that element, removing it when the mouse leaves the element. Then, in the appropriate CSS, I can apply CSS rules to both li:hover and li.over, solving the problem in IE.
<script language="JavaScript">
startList = function()
{
if (document.all&&document.getElementById)
{
navRoot = document.getElementById("navigation");
for (i=0; i<navRoot.childNodes.length; i++)
{
node = navRoot.childNodes[i];
if (node.nodeName=="LI")
{
node.onmouseover=function()
{
this.className+=" over";
}
node.onmouseout=function()
{
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
</script>
However, the script doesn't parse more than one level deep. What I want is for it to parse one more level down. Anyone here know JS enough to help out?