Skip to content

Instantly share code, notes, and snippets.

@jayllellis
Created July 3, 2015 14:10
Show Gist options
  • Save jayllellis/d57fc33cc7418e2f5306 to your computer and use it in GitHub Desktop.
Save jayllellis/d57fc33cc7418e2f5306 to your computer and use it in GitHub Desktop.
When the user stops scrolling, do something
(function($) {
"use strict";
$(document).ready (function(){
$(window).scroll(function(){
clearTimeout($.data(this, 'scrollTimer'));
$.data(this, 'scrollTimer', setTimeout(function() {// when the user stops scrolling
// do something
}, 500));
});
});// end document ready
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment