Window screenX and screenY property
Definition and Usage
screenX and screenY property returns window relative to the X and Y coordinates of the screen.
grammar
window.screenX
window.screenY
window.screenY
Browser Support
In addition to Internet Explorer, all major browsers support screenX and screenY properties.
Note: IE browsers." Window.screenLeft " and " window.screenTop " to get the same value
Examples
Examples
Returns a new window relative to the X and Y coordinates of the screen:
<html>
<head>
<script>
function openWin()
{
myWindow=window.open('','');
myWindow.document.write("<p>This is 'myWindow'");
myWindow.document.write("<br>ScreenX: " + myWindow.screenX);
myWindow.document.write("<br>ScreenY: " + myWindow.screenY + "</p>");
}
</script>
</head>
<body>
<input type="button" value="Open 'myWindow'" onclick="openWin()">
</body>
</html>
<head>
<script>
function openWin()
{
myWindow=window.open('','');
myWindow.document.write("<p>This is 'myWindow'");
myWindow.document.write("<br>ScreenX: " + myWindow.screenX);
myWindow.document.write("<br>ScreenY: " + myWindow.screenY + "</p>");
}
</script>
</head>
<body>
<input type="button" value="Open 'myWindow'" onclick="openWin()">
</body>
</html>
try it"
Window object