File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -142,12 +142,13 @@ $.position = {
142142 getWithinInfo : function ( element ) {
143143 var withinElement = $ ( element || window ) ,
144144 isWindow = $ . isWindow ( withinElement [ 0 ] ) ,
145- isDocument = ! ! withinElement [ 0 ] && withinElement [ 0 ] . nodeType === 9 ;
145+ isDocument = ! ! withinElement [ 0 ] && withinElement [ 0 ] . nodeType === 9 ,
146+ hasOffset = ! isWindow && ! isDocument ;
146147 return {
147148 element : withinElement ,
148149 isWindow : isWindow ,
149150 isDocument : isDocument ,
150- offset : withinElement . offset ( ) || { left : 0 , top : 0 } ,
151+ offset : hasOffset ? $ ( element ) . offset ( ) : { left : 0 , top : 0 } ,
151152 scrollLeft : withinElement . scrollLeft ( ) ,
152153 scrollTop : withinElement . scrollTop ( ) ,
153154 width : withinElement . outerWidth ( ) ,
You can’t perform that action at this time.
0 commit comments