Last active
August 29, 2015 14:16
-
-
Save kmaida/16966a330b005d320e2c to your computer and use it in GitHub Desktop.
Get the current position of the scrollbar with JavaScript
This file contains 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
// Firefox uses HTML, Webkit uses body, iOS uses pageYOffset, therefore check for any: | |
var scrollPosition = document.documentElement.scrollTop || document.body.scrollTop || window.pageYOffset; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment