X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fdimensions.js;h=7371f00fa75fba8beaa75e92ce23a7da2f0f1b1f;hb=a974b255c30ac23906ba45bf95de99542a70b587;hp=2ba8f670d52d6f22187ffb8e5355346584b3cf3b;hpb=848c45ea17cc03bcabd7ab882359e1c62f9485f5;p=jquery.git diff --git a/src/dimensions.js b/src/dimensions.js index 2ba8f67..7371f00 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -1,26 +1,22 @@ // Create innerHeight, innerWidth, outerHeight and outerWidth methods jQuery.each([ "Height", "Width" ], function(i, name){ - var tl = i ? "Left" : "Top", // top or left - br = i ? "Right" : "Bottom", // bottom or right - lower = name.toLowerCase(); + var type = name.toLowerCase(); // innerHeight and innerWidth jQuery.fn["inner" + name] = function(){ return this[0] ? - jQuery.css( this[0], lower, false, "padding" ) : + jQuery.css( this[0], type, false, "padding" ) : null; }; // outerHeight and outerWidth jQuery.fn["outer" + name] = function(margin) { return this[0] ? - jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) : + jQuery.css( this[0], type, false, margin ? "margin" : "border" ) : null; }; - var type = name.toLowerCase(); - jQuery.fn[ type ] = function( size ) { // Get window width or height return this[0] == window ?