Skip to content

Commit

Permalink
Make sure setting opacity does not clobber other inline filters. Fixe…
Browse files Browse the repository at this point in the history
…s #7101.
  • Loading branch information
Colin Snover authored and jeresig committed Sep 30, 2010
1 parent cb811c0 commit 06c505d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/css.js
Expand Up @@ -204,7 +204,7 @@ if ( !jQuery.support.opacity ) {

style.filter = ralpha.test(filter) ?
filter.replace(ralpha, opacity) :
opacity;
style.filter + ' ' + opacity;
}
};
}
Expand Down
9 changes: 6 additions & 3 deletions test/unit/css.js
Expand Up @@ -114,11 +114,14 @@ if(jQuery.browser.msie) {

var filterVal = "progid:DXImageTransform.Microsoft.Alpha(opacity=30) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)";
var filterVal2 = "progid:DXImageTransform.Microsoft.alpha(opacity=100) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)";
var filterVal3 = "progid:DXImageTransform.Microsoft.Blur(pixelradius=5)";
jQuery('#foo').css("filter", filterVal);
equals( jQuery('#foo').css("filter"), filterVal, "css('filter', val) works" );
jQuery('#foo').css("opacity", 1)
equals( jQuery('#foo').css("filter"), filterVal2, "Setting opacity in IE doesn't clobber other filters" );
equals( jQuery('#foo').css("opacity"), 1, "Setting opacity in IE with other filters works" )
jQuery('#foo').css("opacity", 1);
equals( jQuery('#foo').css("filter"), filterVal2, "Setting opacity in IE doesn't duplicate opacity filter" );
equals( jQuery('#foo').css("opacity"), 1, "Setting opacity in IE with other filters works" );
jQuery('#foo').css("filter", filterVal3).css("opacity", 1);
ok( jQuery('#foo').css("filter").indexOf(filterVal3) !== -1, "Setting opacity in IE doesn't clobber other filters" );
});
}

Expand Down

0 comments on commit 06c505d

Please sign in to comment.