Skip to content

Instantly share code, notes, and snippets.

@MartijnR
Last active December 10, 2015 07:18
Show Gist options
  • Save MartijnR/4400402 to your computer and use it in GitHub Desktop.
Save MartijnR/4400402 to your computer and use it in GitHub Desktop.
resizestop event
$(window).on('resize', function(){
var resizeCount = $(window).data('resizecount') || 0;
resizeCount++;
$(window).data('resizecount', resizeCount);
window.setTimeout(function(){
if (resizeCount == $(window).data('resizecount')){
$(window).data('resizecount', 0);
//do the things
console.debug('resizing stopped');
.........;
}
}, 500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment