<script language="javascript" type="text/javascript"> var oldX; var oldY; var newx; var newy; function MouseDown(obj) { oldX = event.x-obj.style.pixelLeft; oldY = event.y-obj.style.pixelTop; obj.setCapture(); //writePos(oldX,oldY) //====>这里获得控制权 } function MouseUp(obj) { obj.releaseCapture(); //=====这里释放控制 } function MouseMove(obj) { if(event.button==1) { obj.style.pixelLeft = (event.x-oldX); obj.style.pixelTop = (event.y-oldY); newx=(event.x-oldX); newy=(event.y-oldY); //writePos(newx,newy); } } function writePos(intLeft,intTop) { label.innerText = " 图left:" + intLeft + " 图top:" + intTop ; } function fnContextMenu() { window.event.returnValue=false; } </script><script language="javascript" type="text/javascript"> var oldX; var oldY; var newx; var newy; function MouseDown(obj) { oldX = event.x-obj.style.pixelLeft; oldY = event.y-obj.style.pixelTop; obj.setCapture(); //writePos(oldX,oldY) //====>这里获得控制权 } function MouseUp(obj) { obj.releaseCapture(); //=====这里释放控制 } function MouseMove(obj) { if(event.button==1) { obj.style.pixelLeft = (event.x-oldX); obj.style.pixelTop = (event.y-oldY); newx=(event.x-oldX); newy=(event.y-oldY); //writePos(newx,newy); } } function writePos(intLeft,intTop) { label.innerText = " 图left:" + intLeft + " 图top:" + intTop ; } function fnContextMenu() { window.event.returnValue=false; } </script>
移用图片
最新推荐文章于 2024-05-05 08:00:00 发布