mirror of
https://github.com/jquery/jquery.git
synced 2026-02-06 21:37:37 -05:00
Fix #12685. Handle inconsistent opacity for ie < 9. Close gh-1005.
This commit is contained in:
10
src/css.js
10
src/css.js
@@ -1,6 +1,6 @@
|
||||
var curCSS, iframe, iframeDoc,
|
||||
ralpha = /alpha\([^)]*\)/i,
|
||||
ropacity = /opacity=([^)]*)/,
|
||||
ropacity = /opacity\s*=\s*([^)]*)/,
|
||||
rposition = /^(top|right|bottom|left)$/,
|
||||
// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
|
||||
// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
||||
@@ -535,7 +535,9 @@ if ( !jQuery.support.opacity ) {
|
||||
style.zoom = 1;
|
||||
|
||||
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
|
||||
if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
|
||||
// if value === "", then remove inline opacity #12685
|
||||
if ( ( value >= 1 || value === "" ) &&
|
||||
jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
|
||||
style.removeAttribute ) {
|
||||
|
||||
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
|
||||
@@ -543,8 +545,8 @@ if ( !jQuery.support.opacity ) {
|
||||
// style.removeAttribute is IE Only, but so apparently is this code path...
|
||||
style.removeAttribute( "filter" );
|
||||
|
||||
// if there there is no filter style applied in a css rule, we are done
|
||||
if ( currentStyle && !currentStyle.filter ) {
|
||||
// if there is no filter style applied in a css rule or unset inline opacity, we are done
|
||||
if ( value === "" || currentStyle && !currentStyle.filter ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user