Skip to content

Commit 381d51a

Browse files
committed
fix scrollposition for IE
IE 11 (and below?) doesn't know scrollY, so we fallback to pageYOffset. Didn't test if pageYOffset is the better choice for all browsers.
1 parent afd6afc commit 381d51a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sloth.max.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
branch;
2222

2323
if(i){
24-
wTop = context.scrollY;
24+
wTop = context.scrollY || context.pageYOffset;
2525
wBottom = wTop + context.innerHeight;
2626

2727
while(i--){
@@ -76,4 +76,4 @@
7676
}else{
7777
context.sloth = sloth();
7878
}
79-
})(this);
79+
})(this);

0 commit comments

Comments
 (0)