Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

IE8 JavaScript: -ms-filter: "alpha(opacity=50)";

How can I do this with JavaScript for IE8?
      -ms-filter: "alpha(opacity=50)";
Avatar of Adoryc666
Adoryc666

Here you go that should work in all the browsers.
.shaded {
-ms-filter: “progid:DXImageTransform.Microsoft.Alpha(Opacity=0.5)”;
filter: alpha(opacity=0.5);
-khtml-opacity: 0.5;
-moz-opacity: 0.5;
opacity: 0.5;
}

Open in new window

Sorry it should be.
.shaded {
-ms-filter: “progid:DXImageTransform.Microsoft.Alpha(Opacity=50)”;
filter: alpha(opacity=50);
-khtml-opacity: 0.5;
-moz-opacity: 0.5;
opacity: 0.5;
}

Open in new window

Avatar of StealthyDev
I think the below code should work?

element.style.filter = 'alpha(opacity:50)';

Open in new window

You can also check: http://www.javascriptkit.com/filters/filterschecklist.shtml for more detailed filters.
ASKER CERTIFIED SOLUTION
Avatar of StealthyDev
StealthyDev

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial