Skip to content

Instantly share code, notes, and snippets.

@chrisjreber
Created June 20, 2017 20:50
Show Gist options
  • Save chrisjreber/4d2b2376276a244285dd95cbb344c358 to your computer and use it in GitHub Desktop.
Save chrisjreber/4d2b2376276a244285dd95cbb344c358 to your computer and use it in GitHub Desktop.
(function($) {
var resizeTimer; // Set resizeTimer to empty so it resets on page load
function resizeFunction() {
// Add functions here
}
// On resize, run the function and reset the timeout
// 250 is the delay in milliseconds. Change as you see fit.
$(window).resize(function() {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(resizeFunction, 100);
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment