一段鼠标移动div的代码.希望对大家有用.
<script language=javascript> //实现层的拖移 var div_x,div_y=0; function divMove(obj) { if(event.button==1) { var divX=obj.clientLeft; var divY=obj.clientTop; obj.style.pixelLeft=divX+(event.x-div_x); obj.style.pixelTop=divY+(event.y-div_y); } } </script>
标题