Javascript broke in IE7?

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?

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!
 
safeastinkywinky said:
some Javascript I wrote
No you didn't.

IE7 doesn't require that javascript since it supports the :hover pseudo-class on elements other than <a>. That javascript is for <=IE6, so I expect it's something else that's giving you problems.
 
Back
Top Bottom