DOM:event.screenY
From MDC
Contents |
[edit] Summary
Returns the vertical coordinate of the event within the screen as a whole..
[edit] Syntax
pixelNumber = event.screenY
pixelNumberis the offset from the top of the screen in pixels.
[edit] Example
<html>
<head>
<title>screenX\screenY example</title>
<script type="text/javascript">
function showCoords(evt){
alert(
"screenX value: " + evt.screenX + "\n"
+ "screenY value: " + evt.screenY + "\n"
);
}
</script>
</head>
<body onmousedown="showCoords(event)">
<p>To display the mouse coordinates click anywhere on the page.</p>
</body>
</html>
[edit] Notes
When you trap events on the window, document, or other roomy elements, you can get the coordinates of that event (e.g., a click) and route it properly, as the "clickMap" example demonstrates.