JavaScript Reference/Javascript Properties/screenY window

Материал из Web эксперт
Перейти к: навигация, поиск

"screenY-window" Example

    
<html>
<body>
<script language="JavaScript">
function function2() {
    mySX.innerHTML = window.event.screenX;
    mySY.innerHTML = window.event.screenY;
}
</script>
<p>
   <b>Screen X:</b> 
   <span id="mySX">0</span>
</p>
<p>
   <b>Screen Y:</b> 
   <span id="mySY">0</span>
</p>
<div id="myDiv" 
     onmousemove="function2();" 
     style="border:solid; width:200; height:50; overflow:scroll;">
   <img src="yourimage.gif">
</div>
</body>
</html>



"screenY-window" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |window                                                        |
+----------------+--------------------------------------------------------------+



"screenY-window" Syntax and Note

Note:
Read-only property. 
Returns the position of the outer boundary of the browser window. 
    
Syntax:
    
window.screenX
window.screenY