From: John Resig Date: Sat, 15 Mar 2008 19:00:07 +0000 (+0000) Subject: Made outerHeight/outerWidth accept .outerWidth(true) to include the margin. If any... X-Git-Tag: 1.2.4a~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d44ddef720684d1eccba8cfe7d1afbaac5327378;p=jquery.git Made outerHeight/outerWidth accept .outerWidth(true) to include the margin. If any options are passed in it's assumed that you want the margin included. --- diff --git a/src/offset.js b/src/offset.js index 4cd58cf7f..010c57d19 100644 --- a/src/offset.js +++ b/src/offset.js @@ -111,15 +111,12 @@ jQuery.each(["Height", "Width"], function(i, name){ }; // outerHeight and outerWidth - jQuery.fn["outer" + name] = function(options) { - options = jQuery.extend({ margin: false }, options); - + jQuery.fn["outer" + name] = function(margin) { return this["inner" + name]() + num(this, "border" + tl + "Width") + num(this, "border" + br + "Width") + - (options.margin ? - num(this, "margin" + tl) + num(this, "margin" + br) : - 0); + (!!margin ? + num(this, "margin" + tl) + num(this, "margin" + br) : 0); }; });