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
/** | |
* scroll distance | |
* pixel distance to bottom of viewport | |
*/ | |
function depth(){ | |
return (window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop || 0) + | |
(window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) | |
} | |
/** | |
* height of the page in pixels | |
*/ | |
function pageHeight(){ | |
return Math.max( | |
document.body.scrollHeight, | |
document.documentElement.scrollHeight, | |
document.body.offsetHeight, | |
document.documentElement.offsetHeight, | |
document.body.clientHeight, | |
document.documentElement.clientHeight | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment