Created
July 16, 2017 21:01
-
-
Save Chalarangelo/627c8a6e1e5f9ed6b02eb91ad46b460a to your computer and use it in GitHub Desktop.
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
// Get page scroll percentage. | |
function getScrollPercent() { | |
return ( | |
(document.documentElement.scrollTop || document.body.scrollTop) | |
/ ( (document.documentElement.scrollHeight || document.body.scrollHeight) | |
- document.documentElement.clientHeight) | |
* 100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment