Position: Support positioning within document with jQuery 1.6.x

Fixes #10071
Closes gh-1294
This commit is contained in:
Scott González 2014-07-24 15:29:40 -04:00
parent f7429edfe9
commit 9bb51d308e

View File

@ -123,8 +123,11 @@ $.position = {
offset: withinElement.offset() || { left: 0, top: 0 },
scrollLeft: withinElement.scrollLeft(),
scrollTop: withinElement.scrollTop(),
width: isWindow ? withinElement.width() : withinElement.outerWidth(),
height: isWindow ? withinElement.height() : withinElement.outerHeight()
// support: jQuery 1.6.x
// jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
};
}
};