var offset_x; var offset_y; function Milan_StartMove(oEvent) { var whichButton; if(document.all&oEvent.button==1)whichButton=true; else { if(oEvent.button==0)whichButton=true;} if(whichButton) { var oDiv=document.getElementById("oDiv"); offset_x=parseInt(oEvent.clientX-oDiv.offsetLeft); offset_y=parseInt(oEvent.clientY-oDiv.offsetTop); document.documentElement.onmousemove=function(mEvent) { var eEvent; if(document.all) eEvent=事件 else{eEvent=mEvent;} var oDiv=document.getElementById("oDiv"); var x=eEvent.clientX-offset_x; var y=eEvent.clientY-offset_y; oDiv.style.left=(x) "px"; oDiv.style.top=(y) "px"; } } } function Milan_StopMove(oEvent){document.documentElement.onmousemove=null; } 腳本>; 頭>