Skip to content

Instantly share code, notes, and snippets.

@samanpwbb
Created April 24, 2013 22:29
Show Gist options
  • Save samanpwbb/5456139 to your computer and use it in GitHub Desktop.
Save samanpwbb/5456139 to your computer and use it in GitHub Desktop.
var getTop = function(el) {
var id = el.attr('href');
return $(id).offset().top;
};
var getBottom = function(el) {
var id = el.attr('href');
return $(document).height() - ($(id).offset().top + $(id).height());
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment