Window.windowState

Jump to:

The windowState read-only property of the Window interface returns the window's current state.

More info on window events and Window.state can be seen here.

Syntax

var state = window.windowState;

Return value

Possible windowState values are:

State Value Description
STATE_MAXIMIZED 1 The window is maximized.
STATE_MINIMIZED 2 The window is minimized.
STATE_NORMAL 3 The window is normal.
STATE_FULLSCREEN 4 The window is in full screen mode.

Example

if (window.windowState === 1) {} // window is maximized
else if (window.windowState === 2) {} // window is minimized
else if (window.windowState === 3) {} // window is normal
else if (window.windowState === 4) {} // window is in fullscreen mode
else {}

Document Tags and Contributors

Contributors to this page: mfluehr, fscholz, kscarfone, jswisher, NatureShade
Last updated by: mfluehr,