Brandon Aaron schrieb:
> Okay so I've updated the plugin once again. This time I finally
> understand where the conflict was coming from in the differences
> between jQuery core and the dimensions plugin.
> 
> The dimensions plugin now returns the value of .height() and .width()
> as an integer. This means that all return values are integers in the
> dimensions plugin.
> 
> I have left some code in the .height() and .width() methods to take a
> value to set the height or width. This behavior will not be documented
> and is to be deprecated in 1.1 but I have left it in for backwards
> compatibility. Do not rely on this behavior because it will be removed
> in the future.
> 
> --
> Brandon Aaron

Thanks, Brandon!

Here's another thing:

Firefox reports for example the computed height of an element as 
"43.6px" via css('height').

With jQuery 1.04 plus newest dimensions height() returns 43 via parsing 
from the computed value, but jQuery 1.04 without dimensions returns 44.

This is because the dimensions plugin uses:

this.css("height")

instead of:

jQuery.css(this[0], 'height')

The latter uses offsetHeight/clientHeight to get the real values and 
will also use the trick to compute heights of hidden elements. The way 
it is now is that the dimensions plugin height() returns NaN for an 
element that is hidden. If this is intended I propose something like the 
following to make it more reasonable:

var h = parseInt(this.css("height", arguments[0]));
return !isNaN(h) && h || 0;

If it is intended to provide the height even for hidden elements, it 
should be changed to this:

return arguments[0] != undefined ? this.css("height", arguments[0]) : 
parseInt( jQuery.css(this[0], "height") );

I vote for the latter. This applies to jQuery 1.1 as well (tested).


-- Klaus





_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to