The resizeend event

The resizeend event

Hi guys,

I was irritated how Firefox and Chrome fire the resize event multiple times while the user resizes the browser window, so I wrote a little script to deal with that...

The issues...

Firefox = if you resize the browser window using the "resize area" at the bottom right corner of the window, then the resize event will be fired every ~20ms for as long as you drag the corner of the window.

Chrome = if you resize the browser window, the resize event will be fired twice !!

Since I want to run some complex code on window.resize, I can't afford to run it multiple times during one single resizing, so I wrote this JS snippet to deal with that.

It is located here:

(URL removed; I don't have the demo online anymore)



Is is not a custom jQuery event, it's just a setTimeout that runs the code only after all resizing is done...

I WOULD LOVE TO SEE THIS IMPLEMENTED IN JQUERY!! (or at least in a plug-in)
So that you can write this...

$(window).resizeend(function() {
      // run this code only once after the user finished resizing
}); 

Feel free to comment :)