@@ -88,8 +88,10 @@ $.position = {
8888 return ( cachedScrollbarWidth = w1 - w2 ) ;
8989 } ,
9090 getScrollInfo : function ( within ) {
91- var overflowX = within . isWindow ? "" : within . element . css ( "overflow-x" ) ,
92- overflowY = within . isWindow ? "" : within . element . css ( "overflow-y" ) ,
91+ var overflowX = within . isWindow || within . isDocument ? "" :
92+ within . element . css ( "overflow-x" ) ,
93+ overflowY = within . isWindow || within . isDocument ? "" :
94+ within . element . css ( "overflow-y" ) ,
9395 hasOverflowX = overflowX === "scroll" ||
9496 ( overflowX === "auto" && within . width < within . element [ 0 ] . scrollWidth ) ,
9597 hasOverflowY = overflowY === "scroll" ||
@@ -101,10 +103,12 @@ $.position = {
101103 } ,
102104 getWithinInfo : function ( element ) {
103105 var withinElement = $ ( element || window ) ,
104- isWindow = $ . isWindow ( withinElement [ 0 ] ) ;
106+ isWindow = $ . isWindow ( withinElement [ 0 ] ) ,
107+ isDocument = ! ! withinElement [ 0 ] && withinElement [ 0 ] . nodeType === 9 ;
105108 return {
106109 element : withinElement ,
107110 isWindow : isWindow ,
111+ isDocument : isDocument ,
108112 offset : withinElement . offset ( ) || { left : 0 , top : 0 } ,
109113 scrollLeft : withinElement . scrollLeft ( ) ,
110114 scrollTop : withinElement . scrollTop ( ) ,
0 commit comments