[jQuery] jQuery height() and width() methods

[jQuery] jQuery height() and width() methods


On a particular project I'm working on, I noticed that when I use the
height() method on an element with padding, the element kind of
twitches, and the value returned is only the height of the element
WITHOUT padding. Looking into the code, the jQuery.css() function
sets all padding and border values to 0 before firing the swap
function to determine computed pixel height/width. This in effect
sets the css for the element momentarily to have no padding or border
before returning it to its original state, causing the weird twitch.
Is there a reason not to include the padding and border in the
computed width/height of an element? Seems incorrect to me, but maybe
I just don't know what I'm talking about...