<SCRIPT language=JavaScript>
var cursorX,cursorY,obj=null;
var moveAble=true;
function enableMove(index){
cursorX=event.clientX;
cursorY=event.clientY;
obj=index;
}
function disableMove() {obj=null;
}
function move_ie(){
if(obj && moveAble){
DIV_name=obj.id;
moveX=event.clientX;
moveY=event.clientY;
//if(moveX>240)
//moveX=240;
//if(moveX<0)
//moveX=0;
//if(moveY>54)
//moveY=54;
//if(moveY<40)
//moveY=40;
document.all[DIV_name].style.posLeft+=moveX-cursorX;
document.all[DIV_name].style.posTop+=moveY-cursorY;
if(document.all[DIV_name].style.posLeft>226)
document.all[DIV_name].style.posLeft=226;
if(document.all[DIV_name].style.posLeft<0)
document.all[DIV_name].style.posLeft=0;
if(document.all[DIV_name].style.posTop!=40)
document.all[DIV_name].style.posTop=40;
cursorX=moveX;
cursorY=moveY;
}
}
</SCRIPT>
<table width="240" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80" height="40"> </td>
<td width="80"> </td>
<td width="80"> </td>
</tr>
<tr>
<td colspan="3" height="14" bgcolor="#000000"><span ><div id=div1 onmousemove="move_ie();" onmousedown="enableMove(this);"onmouseup="disableMove();" style="POSITION: absolute;Z-INDEX: 100; left:0; top:40; cursor:pointer"><img src="../images/498ebf94020008o6.gif" width="14" height="14"/></div></span></td>
</tr>
<tr>
<td height="40"> </td>
<td> </td>
<td> </td>
</tr>
</table>
[此贴子已经被作者于2007-4-11 14:08:11编辑过]