X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcss.js;h=f2165f904c05b8afbda90992846f16d3661cfe28;hb=d9a3e0080a4ffe472a2ee4458b223fb1feb8021c;hp=d0e55db0f4ed1b040a06e722e2374f8c01d51f10;hpb=b0dcc1746f58f5aca17a12794dd928c0deaaa6a0;p=jquery.git diff --git a/src/css.js b/src/css.js index d0e55db..f2165f9 100644 --- a/src/css.js +++ b/src/css.js @@ -169,6 +169,10 @@ jQuery.each(["height", "width"], function( i, name ) { }); } + if ( val < 0 || val === 0 && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { + return elem.style[ name ] || "0px"; + } + return val + "px"; } }, @@ -230,6 +234,9 @@ if ( getComputedStyle ) { if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) { ret = computedStyle.getPropertyValue( name ); + if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { + ret = jQuery.style( elem, name ); + } } return ret;