File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -114,13 +114,14 @@ $.position = {
114
114
} ,
115
115
getWithinInfo : function ( element ) {
116
116
var withinElement = $ ( element || window ) ,
117
- isWindow = $ . isWindow ( withinElement [ 0 ] ) ,
118
- isDocument = ! ! withinElement [ 0 ] && withinElement [ 0 ] . nodeType === 9 ;
117
+ isWindow = $ . isWindow ( withinElement [ 0 ] ) ,
118
+ isDocument = ! ! withinElement [ 0 ] && withinElement [ 0 ] . nodeType === 9 ,
119
+ hasOffset = ! isWindow && ! isDocument ;
119
120
return {
120
121
element : withinElement ,
121
122
isWindow : isWindow ,
122
123
isDocument : isDocument ,
123
- offset : withinElement . offset ( ) || { left : 0 , top : 0 } ,
124
+ offset : hasOffset ? $ ( element ) . offset ( ) : { left : 0 , top : 0 } ,
124
125
scrollLeft : withinElement . scrollLeft ( ) ,
125
126
scrollTop : withinElement . scrollTop ( ) ,
126
127
You can’t perform that action at this time.
0 commit comments