Skip to content

Instantly share code, notes, and snippets.

@monyskynet
Created July 26, 2013 02:04
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 monyskynet/6085480 to your computer and use it in GitHub Desktop.
Save monyskynet/6085480 to your computer and use it in GitHub Desktop.
Display scroll position
var isHintShown = false; $(document).on('scroll', function(e) { var doc = $(this); if (!isHintShown && (doc.scrollTop() >= Math.round(doc.height() / 2))) { console.log('Middle'); isHintShown = true; } } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment