screenY 事件屬性
定義和用法
screenY 事件屬性可返回事件發(fā)生時(shí)鼠標(biāo)指針相對(duì)于屏幕的垂直坐標(biāo)。
語法
event.screenY
實(shí)例
下面的例子可顯示出事件發(fā)生時(shí)鼠標(biāo)指針的坐標(biāo):
<html> <head> <script type="text/javascript"> function show_coords(event) { x=event.screenX
y=event.screenY
alert("X coords: " + x + ", Y coords: " + y) } </script> </head> <body onmousedown="show_coords(event)"> <p>Click in the document. An alert box will alert the x and y coordinates of the cursor.</p> </body> </html>
TIY
- screenY
- 提示鼠標(biāo)指針的坐標(biāo)。