Bug Tracker

Opened 5 years ago

Closed 5 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 5 years ago by lrbabe

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

comment:3 Changed 5 years ago by rwaldron

  • Component changed from unfiled to css
  • Priority changed from undecided to high
  • Status changed from new to open

Can you add some unit tests for this?

comment:4 Changed 5 years ago by john

  • Milestone changed from 1.next to 1.6
  • Resolution set to fixed
  • Status changed from open to closed

Landed.

Note: See TracTickets for help on using tickets.