Skip to content

Instantly share code, notes, and snippets.

@alrnz
Last active February 12, 2020 09:45
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 alrnz/56e8a309da4ffd299a1016b6239701f4 to your computer and use it in GitHub Desktop.
Save alrnz/56e8a309da4ffd299a1016b6239701f4 to your computer and use it in GitHub Desktop.
jQuery onResizeEnd Function
var resizeEndDelay = 150;
var resizeEndTimeout;
window.onresize = function(){
clearTimeout(resizeEndTimeout);
resizeEndTimeout = setTimeout(function(){
$(document).trigger('resizeEnd');
}, resizeEndDelay);
};
$(document).on("resizeEnd", function (event) {
console.log("I have not resized for " + resizeEndDelay + "ms");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment