Bug Tracker

Opened 13 years ago

Closed 12 years ago

#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:
Blocked by: Blocking:

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:

  1. Use elem.currentStyle['filter'] to see the full filter list
  2. If the Alpha filter isn't already applied, add to the filter list (space- or comma-delimited)
  3. If it does exist previously, modify via elem.filters["DXImageTransform.Microsoft.Alpha"].opacity = Number_between_0_and_100

Change History (4)

comment:2 Changed 13 years ago by lrbabe

Here is a pull request, also fixing #8401 https://github.com/jquery/jquery/pull/256

comment:3 Changed 13 years ago by Rick Waldron

Component: unfiledcss
Priority: undecidedhigh
Status: newopen

Can you add some unit tests for this?

comment:4 Changed 12 years ago by john

Milestone: 1.next1.6
Resolution: fixed
Status: openclosed

Landed.

Note: See TracTickets for help on using tickets.