Created
November 17, 2014 16:08
-
-
Save mahemoff/f63276756660c7bee8a7 to your computer and use it in GitHub Desktop.
Live scrolling calculation - can user see bottom of element (or already scrolled past it)
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
elementBottom = $(element).offset().top + $(element).height() | |
lowestVisiblePointInBrowser = $(window).scrollTop() + $(window).height() | |
isElementBottomVisible = lowestVisiblePointInBrowser > elementBottom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment