diff options
author | John Resig <jeresig@gmail.com> | 2010-09-04 23:34:52 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-09-04 23:34:52 -0400 |
commit | 426045cc741b76ce95cf91ff5818879b3d067b76 (patch) | |
tree | 3c1bcb007b0ba83379df9b5b39e433b84d8290ba /src | |
parent | 1970154c3b50d3cbc990b93b48d7448390bd84cf (diff) | |
download | jquery-426045cc741b76ce95cf91ff5818879b3d067b76.tar.gz jquery-426045cc741b76ce95cf91ff5818879b3d067b76.zip |
Some more minor formatting tweaks.
Diffstat (limited to 'src')
-rw-r--r-- | src/css.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/css.js b/src/css.js index 6f26fd0c6..dab3783f3 100644 --- a/src/css.js +++ b/src/css.js @@ -39,14 +39,15 @@ jQuery.extend({ opacity: { get: function( elem, force ) { var style = elem.style; + if ( jQuery.support.opacity && !style.filter ) { return false; // move along, nothing to see here } // IE uses filters for opacity var ret = ropacity.test(elem.currentStyle.filter || "") ? - (parseFloat(RegExp.$1) / 100) + "" : - ""; + (parseFloat(RegExp.$1) / 100) + "" : + ""; return ret === "" ? "1" : @@ -55,6 +56,7 @@ jQuery.extend({ set: function( elem, value ) { var style = elem.style; + if ( jQuery.support.opacity && !style.filter ) { return false; // move along, nothing to see here } @@ -64,9 +66,15 @@ jQuery.extend({ style.zoom = 1; // Set the alpha filter to set the opacity - var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"; + var opacity = parseInt( value, 10 ) + "" === "NaN" ? + "" : + "alpha(opacity=" + value * 100 + ")"; + var filter = style.filter || jQuery.curCSS( elem, "filter" ) || ""; - style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity; + + style.filter = ralpha.test(filter) ? + filter.replace(ralpha, opacity) : + opacity; } } }, |