X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fdimensions.js;h=42e3f1d638890f74f5559cbf0dce2c20be8cd54f;hb=3f5ff3097c315456fe92c9b1e4578590e1eb8648;hp=f052b55052025ba86a46f3ced1274820cae0bc2e;hpb=bd4154879270c872e331054a9c481ca0d318517c;p=jquery.git diff --git a/src/dimensions.js b/src/dimensions.js index f052b55..42e3f1d 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -3,23 +3,23 @@ jQuery.each([ "Height", "Width" ], function(i, name){ var tl = name == "Height" ? "Top" : "Left", // top or left br = name == "Height" ? "Bottom" : "Right"; // bottom or right - + // innerHeight and innerWidth jQuery.fn["inner" + name] = function(){ - return this[ name.toLowerCase() ]() + - num(this, "padding" + tl) + + return this[ name.toLowerCase() ]() + + num(this, "padding" + tl) + num(this, "padding" + br); }; - + // outerHeight and outerWidth jQuery.fn["outer" + name] = function(margin) { - return this["inner" + name]() + + return this["inner" + name]() + num(this, "border" + tl + "Width") + num(this, "border" + br + "Width") + - (!!margin ? + (!!margin ? num(this, "margin" + tl) + num(this, "margin" + br) : 0); }; - + }); function num(elem, prop) {