Created
July 11, 2016 07:40
-
-
Save chnbohwr/eb5fc555291fe91a667c6045e5e5b706 to your computer and use it in GitHub Desktop.
javascript is scroll bottom function
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
| function isBottom(){ | |
| var windowHeight = window.innerHeight | |
| || document.documentElement.clientHeight | |
| || document.body.clientHeight; | |
| var scrollTop = $(window).scrollTop(); | |
| var totalHeight = $(document).height(); | |
| var percent = (windowHeight + scrollTop)/totalHeight; | |
| if(percent === 1){ | |
| return true; | |
| }else{ | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment