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 = {
142
142
getWithinInfo : function ( element ) {
143
143
var withinElement = $ ( element || window ) ,
144
144
isWindow = $ . isWindow ( withinElement [ 0 ] ) ,
145
- isDocument = ! ! withinElement [ 0 ] && withinElement [ 0 ] . nodeType === 9 ;
145
+ isDocument = ! ! withinElement [ 0 ] && withinElement [ 0 ] . nodeType === 9 ,
146
+ hasOffset = ! isWindow && ! isDocument ;
146
147
return {
147
148
element : withinElement ,
148
149
isWindow : isWindow ,
149
150
isDocument : isDocument ,
150
- offset : withinElement . offset ( ) || { left : 0 , top : 0 } ,
151
+ offset : hasOffset ? $ ( element ) . offset ( ) : { left : 0 , top : 0 } ,
151
152
scrollLeft : withinElement . scrollLeft ( ) ,
152
153
scrollTop : withinElement . scrollTop ( ) ,
153
154
width : withinElement . outerWidth ( ) ,
You can’t perform that action at this time.
0 commit comments