Skip to content

Commit 9bb51d3

Browse files
committed
Position: Support positioning within document with jQuery 1.6.x
Fixes #10071 Closes jquerygh-1294
1 parent f7429ed commit 9bb51d3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ui/position.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,11 @@ $.position = {
123123
offset: withinElement.offset() || { left: 0, top: 0 },
124124
scrollLeft: withinElement.scrollLeft(),
125125
scrollTop: withinElement.scrollTop(),
126-
width: isWindow ? withinElement.width() : withinElement.outerWidth(),
127-
height: isWindow ? withinElement.height() : withinElement.outerHeight()
126+
127+
// support: jQuery 1.6.x
128+
// jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
129+
width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
130+
height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
128131
};
129132
}
130133
};

0 commit comments

Comments
 (0)