Skip to content

Instantly share code, notes, and snippets.

@sy
Created June 22, 2017 11:09
Show Gist options
  • Save sy/39cd4dfde741127e19202d5f56386f53 to your computer and use it in GitHub Desktop.
Save sy/39cd4dfde741127e19202d5f56386f53 to your computer and use it in GitHub Desktop.
var rtime;
var timeout = false;
var delta = 200;
$(window).resize(function() {
rtime = new Date();
if (timeout === false) {
timeout = true;
setTimeout(resizeend, delta);
}
});
function resizeend() {
if (new Date() - rtime < delta) {
setTimeout(resizeend, delta);
} else {
timeout = false;
console.log('Done resizing');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment