<html>
<body>
<div id=bd style="position:absolute;height:100;width:100;left:103;top:82;background:red;filter:alpha(opacity=50)" ondragover = "drag()">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height="100%" width="100%" id="AutoNumber1">
  <tr>
    <td width="100%"> </td>
  </tr>
</table>
</div>
<script>var x0,y0;
var x1,y1;
function drags()
{
x0 = event.clientX;
y0 = event.clientY;}
function drage(obj)
{}
function drag()
{
x1 = event.clientX;
y1 = event.clientY;
chg(bd);
inp.value = event.offsetX + ":" + event.offsetY;//相对坐标
}
function chg(obj)
{
obj.style.left = x0<x1?x0:x1;
obj.style.top = y0<y1?y0:y1;
obj.style.width = (x1-x0)>0?x1-x0:x0-x1;
obj.style.height =(y1-y0)>0?y1-y0:y0-y1;
}
</script>
<p>
<img border="0" style="cursor:crosshair" src="file:///C:/Documents%20and%20Settings/cylon/My%20Documents/w00913_l.jpg" width="448" height="339" ondragstart="drags()" 
ondragend="drage(this)"
ondragover="drag()"
ondrop = ""></p>
<input id=inp size="20">
</body></html>

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/3102/3102106.xml?temp=.5164301
    ASP象棋
    http://www.adr.gov.cn/download/panyuguang/xq/vml.asp
    www.adr.gov.cn/download/panyuguang/try_htc/board.htm
    下载
    www.adr.gov.cn/download/panyuguang/try_htc.rar
    棋盘htc前进了一歨,可以得到与屏幕无关的坐标系统了,
    这样数据黑红还有服务器端都通用了。
    周末继续完善。
    要在htc里面封装xmlhttp.起无刷新作用的