Skip to content

Instantly share code, notes, and snippets.

@jenter
Last active August 29, 2015 14:16
Show Gist options
  • Save jenter/0f65d9741afd17806997 to your computer and use it in GitHub Desktop.
Save jenter/0f65d9741afd17806997 to your computer and use it in GitHub Desktop.
var timerEl;
$(window).bind("resize", function () {
if (timerEl) {
clearTimeout(timerEl);
}
timerEl = setTimeout(function () {
// put code here ////////
console.log('the page has been resized');
}, 500); // this only fires every 500ms or half second
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment