Skip to content

Instantly share code, notes, and snippets.

@kurtextrem
Created July 30, 2016 06:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurtextrem/01d1f0650fe40d84ce8a1b60892d64ce to your computer and use it in GitHub Desktop.
Save kurtextrem/01d1f0650fe40d84ce8a1b60892d64ce to your computer and use it in GitHub Desktop.
Throttle Function
function on_resize(namespace, callback, t) {
$(window).on('resize.' + namespace, function () {
clearTimeout(t);
t = setTimeout(callback, 100);
});
return callback;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment