Associate
- Joined
- 25 Aug 2004
- Posts
- 163
- Location
- Reading
For some reason some Javascript I wrote which works perfectly on IE6 and Firefox doesn't work with IE7 properly. Can anyone see anything obvious in my code?
Where navLeft is the ul class of a side menu . The code basically draws pop ups to the right of my left navigation menu on hovering over each item in the list by traversing through my unordered list of menu items. Like I said works perfectly in IE6 and FF, but not IE7 for whatever reason!
Code:
startList = function()
{
if (document.all&&document.getElementById)
{
navRoot = document.getElementById("navLeft");
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;
Where navLeft is the ul class of a side menu . The code basically draws pop ups to the right of my left navigation menu on hovering over each item in the list by traversing through my unordered list of menu items. Like I said works perfectly in IE6 and FF, but not IE7 for whatever reason!