Unify the means of detecting a window across the library. Fixes jQuery UI bug #5438...
[jquery.git] / src / offset.js
index a3776c2..650cc08 100644 (file)
@@ -280,7 +280,7 @@ jQuery.each( ["Left", "Top"], function( i, name ) {
 });
 
 function getWindow( elem ) {
-       return ("scrollTo" in elem && elem.document) ?
+       return jQuery.isWindow( elem ) ?
                elem :
                elem.nodeType === 9 ?
                        elem.defaultView || elem.parentWindow :