Hi Guys,

Im currently doing a website now that has a lot of png images in it. And because of that, I had to use pngfix for IE6. i have recoded the main page so that the png images are all in the css file. in the menu for the home page, i have three buttons for navigation - all in png.
The way that I implemented my menu navs is like this: I implemented it using lists and had a bgimage for normal state on the <li> and declared the appropriate styles for it. Now, when i used the png fix - which works by appending a class png to the element that has the png image - the hover are not working correctly. I did the hover events via js by the way and so far its working as expected in firefox.

A snippet of the code:

var navItems = document.getElementById("primary-nav").getElementsByTagName("a");

	for (var i=0; i<navItems.length; i++) {
		navItems[i].onmouseover=function() { this.className = "over";}
		navItems[i].onmouseout=function() { this.className = "menu1"; }
		
	}

It does fine when i hover on the image but then onmouseout,nothing happens and i get this error in IE this.style is null or not an object Any workaround or inputs on this? Im a javascript noob by the way, so I'd really appreciate a detailed explanation on this.

Thanks!

if your code snippet is correct there's no possibility that the error line is stating: "this.style" - since there is no such declaration in it.
There is some other code interference going one there...(!)

This article has been dead for over six months. Start a new discussion instead.