Js 获取屏幕坐标

时间:2014-03-03 01:21:16   收藏:0   阅读:621
bubuko.com,布布扣
<!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>
bubuko.com,布布扣

Js 获取屏幕坐标,布布扣,bubuko.com

原文:http://www.cnblogs.com/shikyoh/p/3576136.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!