Forum Moderators: not2easy

Message Too Old, No Replies

alpha opacity filters IE8 beta2

         

appi2

12:48 pm on May 22, 2008 (gmt 0)

10+ Year Member



Been trying to work out difference between IE7 and IE8 opacity.
By opacity I mean IE filters
Alpha Filters [samples.msdn.microsoft.com]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>IE8 Transparency</title>
<script type="text/javascript">
doIt = function () {
document.getElementsByTagName('h1')[0].style.position = "relative";
document.getElementsByTagName('h1')[0].style.width = 300+"px";
document.getElementsByTagName('h1')[0].style.height = 30+"px";
document.getElementsByTagName('h1')[0].style.filter = 'alpha(opacity=' + 10 + ')';

document.getElementsByTagName('img')[0].style.filter = 'alpha(opacity=' + 10 + ')';
}
</script>
</head>

<body onClick="doIt()">
<h1 style="background:#ff0000;)">main heading</h1>

<img src="img/img1.png">

<h2 style="position:relative; top:0; left:0; width:240px; height:30px; background:green;
filter:progid:DXImageTransform.Microsoft.Alpha( Opacity=10)">
2nd heading</h2>
<img src="img/img2.png" style="filter:progid:DXImageTransform.Microsoft.Alpha( Opacity=10)">
</body>
</html>

If you use a correct doc type you can set opacity through Javascript on images but not on other elements.
opacity doesn't seem to work in css.

No doc type opacity works fine on anything.

Think I've got this right?

swa66

7:48 pm on May 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've not played with IE8 beta2, but if it still doesn't properly support the standard opacity, some heads need to roll in Redmond.

[w3.org...]
Nothing else please!

By the time we get IE8 widely deployed to replace IE6 and IE7 nobody will want to have to mess with those experssions and conditional comments anymore.

There's always hope they'll eventually still fix it, or that all will stop using IE.