views:

171

answers:

1

Hello,

I have a little design problem.

On this page I have a couple of mouseover images. As you can see (only in IE) the images are circled with black when setting the opacity.

I do not have this problem in firefox.

The reason I use opacity, is because when I use hide/show the image, the table where it resides in gets shaky.

Can anyone help resolve this problem?

Thanks, Richard

+2  A: 

That's quite a hack you are using. Ideally, you must hide/show the images on mouseover/mouseout like this -

document.getElementById("imageId").style.display = "none"; //Hide
document.getElementById("imageId").style.display = ""; //Show

If this makes your table shaky, then there has to be some problem with the table structure you are using on your page (I don't see any problem in the table structure on the page tho).

To circumvent this problem you can also use the visibility class like this (instead of using display) -

document.getElementById("imageId").style.visibility = "hidden"; //Hide
document.getElementById("imageId").style.visibility = "visible"; //Show
Kirtan
thank you very much, that worked
Richard
when you want to show you should set the display = 'block'
Dave Anderson
Dave, whether to set the value of the "display" property to "" or "block" depends on whether the element was displayed in block mode or not before being hidden. If it was not displayed as a "block" element, and then you set the value of "display" property to "block", it MAY mess the layout in FF (I've seen some cases).
Kirtan
Opacity is definitely the wrong way to go here. In IE, Opacity is currently implemented as a DirectX filter, which is rather expensive and has quirks.
EricLaw -MSFT-