Skip to content

Instantly share code, notes, and snippets.

@fatuk
Created September 4, 2013 06:42
Show Gist options
  • Save fatuk/6433451 to your computer and use it in GitHub Desktop.
Save fatuk/6433451 to your computer and use it in GitHub Desktop.
Timeout for window resizing
function initFunction(){
// Function that has to be called on document ready and after resize
};
$(window).load(function () {
initFunction();
var resizeTimer;
$(window).resize(function () {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(initFunction, 200);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment