screenY 事件屬性可返回事件發(fā)生時(shí)鼠標(biāo)指針相對(duì)于屏幕的垂直坐標(biāo)。
event.screenY
下面的例子可顯示出事件發(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>
如對(duì)本文有疑問,請(qǐng)?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會(huì)為你解答?。?點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號(hào)