Js 获取屏幕坐标

<!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>

 

posted @ 2014-03-02 00:07  Shikyoh  阅读(11530)  评论(0编辑  收藏  举报