X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=src%2Fdimensions.js;h=17b4f8f96beaa25293e0df7ffc287119dc076274;hp=f5212e1b6b9b67ffc8cf0b9560f2a31f1403d75d;hb=0cbe4cb8bdce9eacd2b63de6e9ca0b662606b633;hpb=53396b879bd29c090824da182e3cf69158829f82 diff --git a/src/dimensions.js b/src/dimensions.js index f5212e1..17b4f8f 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -25,7 +25,7 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { if ( !elem ) { return size == null ? null : this; } - + if ( jQuery.isFunction( size ) ) { return this.each(function( i ) { var self = jQuery( this ); @@ -49,7 +49,9 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { // Get or set width or height on the element } else if ( size === undefined ) { - var orig = jQuery.css( elem, type ), ret = parseFloat( orig ); + var orig = jQuery.css( elem, type ), + ret = parseFloat( orig ); + return jQuery.isNaN( ret ) ? orig : ret; // Set the width or height on the element (default to pixels if value is unitless)