在浏览器中使用 style.filter 时 ie6,ie7,ie8 不起作用



我正在使用(ff,chrome等)浏览器中的 style.opacity
在(IE6,7,8)中,我正在使用style.filter,但不起作用。

,以下是我所做的:

targetElement.style.filter = 'alpha(opacity=30)'; // targetElement is div

仅在 ie9 中工作正常,但在 IE6,7,7,8 中不起作用。为什么?

据我所知,IE 6和7都没有alpha透明过滤器。MS梯度滤波器可以使用α透明度处理RGB。

半透明,几乎是黑色背景(alpha通道是前两个十六进制数字):

filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=#E5333333, endColorstr=#E5333333 );
-ms-filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=#E5333333, endColorstr=#E5333333 );

最新更新