首页 > 代码库 > 标题栏上显示页面上的鼠标坐标

标题栏上显示页面上的鼠标坐标

<!--要完成此效果把如下代码加入到<body>区域中-->    <script language="javascript">    var where = "";    function checkwhere(e) {    if (document.layers){    xCoord = e.x;    yCoord = e.y;    }    else if (document.all){    xCoord = event.clientX;    yCoord = event.clientY;    }    else if (document.getElementById){    xCoord = e.clientX;    yCoord = e.clientY;    }    document.title = "X座标值= "+ xCoord + "  Y座标值= " + yCoord ;    }    document.onmousemove = checkwhere;    if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}    </script>    请看标题栏的显示效果-石家庄地毯-石家庄水泵厂。

 

标题栏上显示页面上的鼠标坐标