When someone continuously drags a window around, resizing it (by the corner for example) and until they stop(let go of mouse button), that's when the function should fire.
I tried this, I noticed that the setTimeout always fires every time that you keep dragging the window(without letting go), I had hoped that the reset would work, but it's not working at the moment.
<script>
var $window = $(window),
timer = 0;
$window.resize(function() {
// reset timer
timer = 50;
setTimeout(function() {
alert('client has stopped re-sizing the window');
}, timer);
});
</script>
I would have thought that this makes sense as you continuously drag the window around, the setTimeout event keeps firing multiple times until you let go, it may have fired a hundred times(have to click a lot)... I only want it to fire when the person finally lets go, regardless of how long they've been dragging the window around changing its size.