resize

Test page.

Events overview page.

The resize event fires when the user resizes the browser window or a resizable element.

Method or property IE 5.5 IE 6 IE 7 IE8b1 FF 2 FF 3 Saf 3.0 Win Saf 3.1 Win iPhone 3G Opera 9.26 Opera 9.51 Konqueror 3.5.7
On the window
Yes Yes Yes Buggy Minimal Yes Yes

Is the resize event available on the window?

  • Opera allows registration on the window only when you use attachEvent.
  • Safari iPhone fires this event at unpredictable times. Sometimes it fires them when the user zooms out completely, when the console is cleared and when you select a new radio button, but sometimes it doesn’t.
On the document
No No No Yes Yes

Is the resize event available on the document?

On any element with resize
Untestable Untestable No Untestable Untestable Untestable

Is the resize event available on an element with the CSS resize declaration?

Event bubbling

I'm not sure if this event should bubble up.

Untestable Untestable Untestable Untestable Incorrect Incorrect
  • In Opera 9.26 the event is captured when using attachEvent registration.
  • In Opera 9.5b and Konqueror the event bubbles when using addEventListener on the capturing phase.
  • When using attachEvent registration, Opera fires the event on the window before the event on the document. (The event isn’t available on the window in any other registration.)
Method or property IE 5.5 IE 6 IE 7 IE8b1 FF 2 FF 3 Saf 3.0 Win Saf 3.1 Win iPhone 3G Opera 9.26 Opera 9.51 Konqueror 3.5.7

Amount of events

In Windows XP Home, “Show window contents while dragging” can be found in My Computer -> (right click) -> Properties -> Advanced -> Settings -> Visual effects.

But how many events fire, and when? That depends partly on your Windows settings (not tested on Mac or Linux).

If you switch “Show window contents while dragging” off, all browsers fire one resize event at the end of the resize (except for IE 5.5 and 6, which fire two).

If you switch it on the browsers do the following: