Created
July 31, 2017 14:53
-
-
Save monkianer/1681e4eaba9d4073e09ca22407acc403 to your computer and use it in GitHub Desktop.
Fix the 'ie' is not compatible with window.scrollY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fix the 'ie' is not compatible with window.scrollY | |
* test with ie 9, 10, 11, edge. | |
**/ | |
function getScrollTop(){ | |
var t = typeof window.scrollY === 'undefined' ? window.pageYOffset : window.scrollY; | |
return t; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment