您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

在JavaScript中,pageY鼠标事件的作用是什么?

2024/2/23 7:19:38发布20次查看
当鼠标事件被触发时,pagey鼠标事件属性用于获取鼠标指针的垂直坐标。坐标是相对于屏幕的。
示例您可以尝试运行以下代码来了解如何实现pagey javascript 中的鼠标事件。
<!doctype html><html> <body> <p onclick="coordsfunc(event)">click here to get the x (horizontal) and y (vertical) coordinates of the mouse pointer.</p> <script> function coordsfunc(event) { var x_coord = event.pagex; var y_coord = event.pagey; var xycoords = "x coords= " + x_coord + ", y coords= " + y_coord; document.write(xycoords); } </script> </body></html>
以上就是在javascript中,pagey鼠标事件的作用是什么?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product