Created
November 22, 2013 22:40
-
-
Save jCrip/7608108 to your computer and use it in GitHub Desktop.
scrollStopped event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.scrollStopped = function(callback) { | |
$(this).scroll(function(){ | |
var self = this, $this = $(self); | |
if ($this.data('scrollTimeout')) { | |
clearTimeout($this.data('scrollTimeout')); | |
} | |
$this.data('scrollTimeout', setTimeout(callback,300,self)); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment