Window screenLeft and screenTop property
Definition and Usage
screenLeft and screenTop property returns window relative to the X and Y coordinates of the screen.
grammar
window.screenLeft
window.screenTop
window.screenTop
Browser Support
All major browsers support screenLeft and screenTop properties, Firefox excluded.
Note: Firefox browser use " window.screenX " and " window.screenY ."
Examples
Examples
Returns a new window relative to the X and Y coordinates of the screen:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function openWin () {
. myWindow = window open ( '' , ''); myWindow document write ( "<p> What is 'My Window'"); myWindow document write ( ..... "<br> ScreenLeft:" + myWindow screenLeft ); myWindow document write ( "<br> screenTop:"... + myWindow screenTop + "</ p>");}
</ Script>
</ Head>
<Body>
<Input type = "button" value = "open 'my window.'" onclick = "openWin ()">
</ Body>
</ Html>
try it"
Window object