Crystalball

导航

javaScript实现在浏览器状态栏显示鼠标在页面中的当前位置

具体代码如下:

<head runat="server">
    <title></title>
    <script type="text/javascript" language="javascript">
        var x = 0, y = 0;
        function MousePlace() {
            x = window.event.x;
            y = window.event.y;
            window.status = "X: " + x + "  " + "Y: " + y + "  ";
        }
        document.onmousemove = MousePlace;
    </script>
</head>

posted on 2012-11-25 13:20  Crystalball  阅读(603)  评论(0编辑  收藏  举报