Skip to content

Instantly share code, notes, and snippets.

@devth
Created January 28, 2011 19:56
Show Gist options
  • Save devth/800837 to your computer and use it in GitHub Desktop.
Save devth/800837 to your computer and use it in GitHub Desktop.
Determine percentage scrolled in window
// assumes jQuery present
var $window = $(window), $document = $(document);
var percent_scrolled = ($window.scrollTop()) / ($document.height() - $window.height());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment