@@ -139,6 +139,8 @@ test('of', function() {
139
139
left : $ ( document ) . width ( ) - 10
140
140
} , 'document' ) ;
141
141
142
+ $ ( window ) . scrollTop ( 0 ) ;
143
+
142
144
$ ( '#elx' ) . position ( {
143
145
my : 'right bottom' ,
144
146
at : 'right bottom' ,
@@ -161,18 +163,24 @@ test('of', function() {
161
163
left : $ ( window ) . width ( ) - 10
162
164
} , 'window' ) ;
163
165
164
- $ ( window ) . scrollTop ( 500 ) . scrollLeft ( 200 ) ;
165
- $ ( '#elx' ) . position ( {
166
- my : 'right bottom' ,
167
- at : 'right bottom' ,
168
- of : window ,
169
- collision : 'none'
170
- } ) ;
171
- same ( $ ( '#elx' ) . offset ( ) , {
172
- top : $ ( window ) . height ( ) + 500 - 10 ,
173
- left : $ ( window ) . width ( ) + 200 - 10
174
- } , 'window, scrolled' ) ;
175
- $ ( window ) . scrollTop ( 0 ) . scrollLeft ( 0 ) ;
166
+ var scrollTopSupport = ( function ( ) {
167
+ $ ( window ) . scrollTop ( 1 ) ;
168
+ return $ ( window ) . scrollTop ( ) == 1 ;
169
+ } ) ( ) ;
170
+ if ( scrollTopSupport ) {
171
+ $ ( window ) . scrollTop ( 500 ) . scrollLeft ( 200 ) ;
172
+ $ ( '#elx' ) . position ( {
173
+ my : 'right bottom' ,
174
+ at : 'right bottom' ,
175
+ of : window ,
176
+ collision : 'none'
177
+ } ) ;
178
+ same ( $ ( '#elx' ) . offset ( ) , {
179
+ top : $ ( window ) . height ( ) + 500 - 10 ,
180
+ left : $ ( window ) . width ( ) + 200 - 10
181
+ } , 'window, scrolled' ) ;
182
+ $ ( window ) . scrollTop ( 0 ) . scrollLeft ( 0 ) ;
183
+ }
176
184
177
185
var event = $ . extend ( $ . Event ( 'someEvent' ) , { pageX : 200 , pageY : 300 } ) ;
178
186
$ ( '#elx' ) . position ( {
0 commit comments