diff options
-rw-r--r-- | ui/jquery.ui.position.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 6c5250959..0b7563b10 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -29,11 +29,11 @@ $.fn.position = function(options) { targetHeight,
basePosition;
- if (options.of == document) {
+ if (options.of.nodeType === 9) {
targetWidth = target.width();
targetHeight = target.height();
basePosition = { top: 0, left: 0 };
- } else if (options.of == window) {
+ } else if ('scrollTo' in options.of && options.of.document) {
targetWidth = target.width();
targetHeight = target.height();
basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
|