Bug Tracker

Ticket #8403 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

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:

  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

comment:1 Changed 3 years ago by anewpage.media@…

comment:2 Changed 3 years ago by lrbabe

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

comment:3 Changed 3 years ago by rwaldron

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

Can you add some unit tests for this?

comment:4 Changed 3 years ago by john

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

Landed.

Note: See TracTickets for help on using tickets.