X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcss.js;h=cf792510401c1aed91ba26610634a49531bcddcc;hb=39a77c2d02d379d15bfe9c2e7b90c92d9cb3a34e;hp=ddd42b4b2c526f0a75f2f325d6229bbbebbdb0ee;hpb=449e099b97d823ed0252d8821880bc0e471701ea;p=jquery.git diff --git a/src/css.js b/src/css.js index ddd42b4..cf79251 100644 --- a/src/css.js +++ b/src/css.js @@ -52,8 +52,9 @@ jQuery.extend({ style.zoom = 1; // Set the alpha filter to set the opacity - style.filter = (style.filter || "").replace( ralpha, "" ) + - (parseInt( value ) + '' === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); + var opacity = parseInt( value, 10 ) + '' === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"; + filter = style.filter || jQuery.curCSS( elem, 'filter' ) || "" + style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity; } return style.filter && style.filter.indexOf("opacity=") >= 0 ? @@ -202,11 +203,12 @@ if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function(elem){ var width = elem.offsetWidth, height = elem.offsetHeight, force = /^tr$/i.test( elem.nodeName ); // ticket #4512 - return ( width === 0 && height === 0 && !force ) ? + + return width === 0 && height === 0 && !force ? true : - ( width !== 0 && height !== 0 && !force ) ? + width !== 0 && height !== 0 && !force ? false : - !!( jQuery.curCSS(elem, "display") === "none" ); + jQuery.curCSS(elem, "display") === "none"; }; jQuery.expr.filters.visible = function(elem){