X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcss.js;h=0f08227b28d0989fc80b75e0cd5df4b9071611a8;hb=d684122be0ce3484fb9a4ead11db98d18c5805e7;hp=6abcc956a44c071d5e975955cb1a72d6c909ba8d;hpb=bbffc99f7c60d42d4286786dfd6a43aa31d62ae2;p=jquery.git diff --git a/src/css.js b/src/css.js index 6abcc95..0f08227 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 + ")"; + var 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 ? @@ -167,7 +168,7 @@ jQuery.extend({ // Put in the new values to get a computed value out elem.runtimeStyle.left = elem.currentStyle.left; - style.left = ret || 0; + style.left = camelCase === "fontSize" ? "1em" : (ret || 0); ret = style.pixelLeft + "px"; // Revert the changed values @@ -202,14 +203,15 @@ 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){ return !jQuery.expr.filters.hidden(elem); }; -} \ No newline at end of file +}