Skip to content

Instantly share code, notes, and snippets.

@adrianmcli
Last active February 26, 2016 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianmcli/ad245226468cd7dba787 to your computer and use it in GitHub Desktop.
Save adrianmcli/ad245226468cd7dba787 to your computer and use it in GitHub Desktop.
scrollHandler = () => {
// Get the element
const ele = $(this._container);
// Compare these two metrics to get the distance scrolled from the bottom
const metricA = ele[0].scrollHeight - ele.scrollTop();
const metricB = ele.outerHeight();
const distanceFromBottom = metricA - metricB;
console.log(`distanceFromBottom: ${distanceFromBottom}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment