Skip to content

Commit d44ddef

Browse files
committed
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.
1 parent 8f14ee1 commit d44ddef

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/offset.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,12 @@ jQuery.each(["Height", "Width"], function(i, name){
111111
};
112112

113113
// outerHeight and outerWidth
114-
jQuery.fn["outer" + name] = function(options) {
115-
options = jQuery.extend({ margin: false }, options);
116-
114+
jQuery.fn["outer" + name] = function(margin) {
117115
return this["inner" + name]() +
118116
num(this, "border" + tl + "Width") +
119117
num(this, "border" + br + "Width") +
120-
(options.margin ?
121-
num(this, "margin" + tl) + num(this, "margin" + br) :
122-
0);
118+
(!!margin ?
119+
num(this, "margin" + tl) + num(this, "margin" + br) : 0);
123120
};
124121

125122
});

0 commit comments

Comments
 (0)