Window screen.availWidth egenskab
- Forrige side availHeight
- Næste side colorDepth
- Gå tilbage et lag Window Screen
Definition and usage
availWidth
The property returns the width of the user's screen.
availWidth
The property returns the width in pixels.
availWidth
The property returns the width minus the width of the Windows taskbar and other interface functions.
availWidth
The property is read-only.
Tip:To get the height of the screen, use availHeight property.
Example
Example 1
Get the available width of the screen:
let width = screen.availWidth;
Example 2
All screen properties:
let text = "Total width/height: " + screen.width + "*" + screen.height + "<br>" "Available width/height: " + screen.availWidth + "*" + screen.availHeight + "<br>" "Color depth: " + screen.colorDepth + "<br>" "Color resolution: " + screen.pixelDepth;
Syntax
screen.availWidth
Return value
Type | Description |
---|---|
Number | The width of the user's screen (in pixels). |
Browser support
All browsers support screen.availWith
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
Related pages
HTML DOM reference manual:screen.availHeight property
HTML DOM reference manual:screen.availWidth property
HTML DOM reference manual:screen.height property
HTML DOM reference manual:screen.width egenskab
- Forrige side availHeight
- Næste side colorDepth
- Gå tilbage et lag Window Screen