webgis系统开发
捕捉鼠标的坐标:
view sourceprint?01 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<A href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target=_blank>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</A>">
02 <html xmlns="<A href="http://www.w3.org/1999/xhtml" target=_blank>http://www.w3.org/1999/xhtml</A>" onmousemove="getMouseSite(event)">
03 <head>
04 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
05 <title>960web</title>
06 </head>
07
08 <body>
09 <div id="a"></div>
10
11 </body>
12 <script>
13 function getMouseSite(e){
14 mouseX = e.clientX;
15 mouseY = e.clientY;
16 document.getElementById("a").innerHTML = "("+mouseX+","+mouseY+")";
17 }
18 </script>
19 </html>
OK!

浙公网安备 33010602011771号