(parseFloat( value ).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
}
- return elem.filter ?
+ return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100).toString() :
"";
}
});
test("css(String, Object)", function() {
- expect(18);
+ expect(19);
ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible');
$('#foo').css('display', 'none');
ok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden');
});
$('#foo').css('opacity', '');
ok( $('#foo').css('opacity') == '1', "Assert opacity is 1 when set to an empty String" );
+ // for #1438, IE throws JS error when filter exists but doesn't have opacity in it
+ if (jQuery.browser.msie) {
+ $('#foo').css("filter", "progid:DXImageTransform.Microsoft.Chroma(color='red');");
+ }
+ equals( $('#foo').css('opacity'), '1', "Assert opacity is 1 when a different filter is set in IE, #1438" );
});
test("jQuery.css(elem, 'height') doesn't clear radio buttons (bug #1095)", function () {