Skip to content
Permalink
Browse files

Position: Changed document/window detection to be consistent with jQu…

…ery core.

Fixes a bug in IE7/8 where window == document.
  • Loading branch information
scottgonzalez committed Nov 19, 2009
1 parent 17829ce commit 3cc921dd3da81612a9fd9d33357d4a99ba4fd01e
Showing with 2 additions and 2 deletions.
  1. +2 −2 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() };

0 comments on commit 3cc921d

Please sign in to comment.
You can’t perform that action at this time.