views:

822

answers:

2

I've problem with opacity for IE8 and Opera9-10. My little JS adds a CSS class to a row (<tr>) when users click on it. This is the class:

.selected { 
    opacity: 0.5;
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE8 */
    filter: alpha(opacity=80); /* IE7 */
}

Opacity is applied in Firefox and Google Chrome but not in IE and Opera.

+2  A: 

From the IE Blog:

.selected { 
    opacity: 0.5;
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE8 */
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);  /* IE7 */
}

If this still doesn't work, it's probably an issue with some inheritance and we'll need to see some scirpt and markup or an online example.

Joel Potter
A: 

What happens if you apply your class to a single TD in the table? Does that work any better? Another option would be to use a PNG with alpha-transparency as a background image for the TR and apply this via your class (but this wouldn't work in IE6).

Dan Diplo
Applying opacity on td (for i.e. on click) doesn't work for Opera and IE :)
I see that on Opera opacity support in JQuery is enabled on IE no