Window screenX Property
- Previous Page
- Next Page
- Go to the Previous Level Window Object
Definition and Usage
screenX
The property returns the x (horizontal) coordinate of the window relative to the screen.
See also:
Instance
Example 1
Open a new window with specified left and top positions and return its coordinates:
const myWin = window.open("", "", "left=700,top=350,width=200,height=100"); let x = myWin.screenX; let y = myWin.screenY;
Example 2
Open a new window and return its coordinates:
const myWin = window.open("", "", "width=200,height=100"); let x = myWin.screenX; let y = myWin.screenY;
Syntax
window.screenX
or:
screenX
Parameter
None.
Return Value
Type | Description |
---|---|
Number | The horizontal distance of the window from the screen in pixels. |
Browser Support
All Browsers Support window.screenX
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | 10-11 | Support | Support | Support | Support |
- Previous Page
- Next Page
- Go to the Previous Level Window Object