Skip to content

Instantly share code, notes, and snippets.

@nvquanghuy
Created September 12, 2014 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nvquanghuy/985bf19a75ebcc2f0128 to your computer and use it in GitHub Desktop.
Save nvquanghuy/985bf19a75ebcc2f0128 to your computer and use it in GitHub Desktop.
resize triggering
// Create a resizeEnd event trigger
$(function () {
$(window).resize(function () {
if (this.resizeTO) clearTimeout(this.resizeTO);
this.resizeTO = setTimeout(function () {
$(this).trigger('resizeEnd');
}, 500);
});
});
$(window).on('resizeEnd', function () {
// do whatever
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment