The timeout is cleared every time a resize event fires, making sure your code is only executed once the resizing actually stopped.
var timer; $(window).on('resize', function(e) { clearTimeout(timer); timer = setTimeout(function() { // Execute }, 250); });