Opacity not working: IE8 vs IE7: seem to care about position style
I have found that in IE8 I cannot give an element the alpha filter (opacity) if it has the position style set to something (relative or absolute). An element without the position style (it is the empty string) can have opacity in IE8.
I have found that in IE7 I can only give an element the alpha filter if the position style is set to something (relative or absolute). An element without a position style will not take the alpha filter.
This is a major conundrum. Does anyone have any insight into this bug? Given the above, I can only achieve opacity in one of the two browsers.
I have both IE8 and IE7 running in standards mode.
The opacity is being set programmatically with JS like so:
obj.style.filter = "alpha(opacity="+opacity+")";
where opacity is an integer between 0 and 100.
Obviously I don't have any problem with any other browser doing opacity because it is different styles for them and they don't care about the position style at all.