Skip to main content

Bug Tracker

Side navigation

#8403 closed bug (fixed)

Opened February 28, 2011 06:19PM UTC

Closed April 12, 2011 04:36AM UTC

jQuery Bulldozes Other IE Filters When Assigning Opacity

Reported by: anewpage.media@gmail.com 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

Attachments (0)
Change History (4)

Changed February 28, 2011 06:24PM UTC by anewpage.media@gmail.com comment:1

Changed March 01, 2011 12:07AM UTC by lrbabe comment:2

Here is a pull request, also fixing #8401

https://github.com/jquery/jquery/pull/256

Changed March 07, 2011 01:11AM UTC by rwaldron comment:3

component: unfiledcss
priority: undecidedhigh
status: newopen

Can you add some unit tests for this?

Changed April 12, 2011 04:36AM UTC by john comment:4

milestone: 1.next1.6
resolution: → fixed
status: openclosed

Landed.