Skip to content

Instantly share code, notes, and snippets.

@richardevcom
Created November 8, 2019 10:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardevcom/0fa5da380a11a19ef59139735ad11606 to your computer and use it in GitHub Desktop.
Save richardevcom/0fa5da380a11a19ef59139735ad11606 to your computer and use it in GitHub Desktop.
window before / on / after resize event
var resizeTimer;
var timeoutInterval = 100; // Timeout interval for resize timer
window.onresize = function(event) {
var status = document.getElementById("status");
// ON RESIZING
status.innerHTML = "Resizing...";
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
// AFTER RESIZING
status.innerHTML = "Resizing done.";
}, timeoutInterval);
};
@richardevcom
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment