Skip to content

Instantly share code, notes, and snippets.

@anthonylrivera
Created July 31, 2015 04:43
Show Gist options
  • Save anthonylrivera/d67f80da524982193d90 to your computer and use it in GitHub Desktop.
Save anthonylrivera/d67f80da524982193d90 to your computer and use it in GitHub Desktop.
Optimized Scroll Detection Technique
var outerPane = $details.find(".details-pane-outer"),
didScroll = false;
$(window).scroll(function() {
didScroll = true;
});
setInterval(function() {
if ( didScroll ) {
didScroll = false;
// Check your page position and then
// Load in more results
}
}, 250);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment