window.onResize

JavaScript1.2+ Nav4+ Syntax

onResize="command"

Description

The onResize event handler of a property of a Window object is fired when the window it is referenced in is resized. The user physically resizing the window or a script resizing it can fire this event.

Example

Listing 7.561 pops up an alert box if the user tries to resize the window.

Listing 7.561 Using the onResize Event to Display an Alert Box
<body onResize='alert("Do NOT resize this window!")'>
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.