Js 获取屏幕坐标
2014-03-02 00:07
302 查看
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script> function getScreen(e) { var x = e.screenX - e.clientX; var y = e.screenY - e.clientY; alert("X坐标:" + x + ",Y坐标:" + y); } </script> </head> <body> <input type="button" onclick="getScreen(event)" value="测试" /> </body> </html>
相关文章推荐
- js获取窗口相对于屏幕左边和上边的位置坐标
- l转 Js 获取屏幕坐标值
- js获取div相对屏幕的坐标位置
- js获取窗口相对于屏幕左边和上边的位置坐标
- Js获取适时获取鼠标坐标值并显示
- jquery & js 获取浏览器、屏幕高度
- js 获取页面元素的坐标值
- JS获取浏览器窗口大小 获取屏幕,浏览器,网页高度宽度
- js获取屏幕(设备)宽高
- JS获取body及屏幕的宽度和高度
- JS获取浏览器窗口大小 获取屏幕,浏览器,网页高度宽度
- js获取屏幕像素
- js获取对象的绝对坐标
- js获取各种窗口的大小和鼠标坐标
- js 获取屏幕各种宽高的方法
- JS获取表格单元格坐标及给指定单元格赋值
- js里获取屏幕尺寸
- js实现获取div坐标的方法
- js获取正文以及屏幕高度
- UIView获取屏幕Screen中的坐标位置