Modify ↓
Ticket #8403 (closed bug: fixed)
jQuery Bulldozes Other IE Filters When Assigning Opacity
| Reported by: | anewpage.media@… | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 1.6 |
| Component: | css | Version: | 1.5.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Steps to Reproduce:
Assign a background gradient to an element in your external CSS, like so:
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffff0000', EndColorStr='#ffffffff');
On the same element, set a moderate opacity:
$(elem).css('opacity', '0.5');
Your gradient will disappear.
Steps to Fix:
- Use elem.currentStyle['filter'] to see the full filter list
- If the Alpha filter isn't already applied, add to the filter list (space- or comma-delimited)
- If it does exist previously, modify via elem.filters["DXImageTransform.Microsoft.Alpha"].opacity = Number_between_0_and_100
Change History
comment:2 Changed 2 years ago by lrbabe
Here is a pull request, also fixing #8401 https://github.com/jquery/jquery/pull/256
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Fiddle: http://jsfiddle.net/brianblakely/22Nac/16/