<script language="JavaScript"> var Obj; function MouseDown(obj) { Obj= obj; Obj.setCapture();//指定窗口里设置鼠标捕获 Obj.l=event.x-Obj.style.pixelLeft; Obj.t=event.y-Obj.style.pixelTop;
} function MouseMove() { if(Obj!=null) { Obj.style.left= event.x-Obj.l; Obj.style.top=event.y-Obj.t;
} } function MouseUp() { if(Obj!=null) { Obj.releaseCapture(); Obj=null;
} } </script> <span style='position:absolute;width:200;height:200;background:red' οnmοusedοwn=MouseDown(this) οnmοusemοve=MouseMove() οnmοuseup=MouseUp()>meizz</span>