<script> <BR>var bb = document.getElementById("block"); <BR>bb.onmousedown = function(){ <BR>//Get the current coordinates of the mouse<BR>var pageX = event.clientX; <BR>var pageY = event.clientY; <BR>//Get the coordinates of the block, left border and upper border<BR>var offX = parseInt(this.style.left)||0; <BR>var offY = parseInt(this.style.top)||0; <BR>//Calculate the distance between the mouse coordinates and the block coordinates<BR>var offLX = pageX-offX; <BR>var offLY = pageY-offY ; <BR>if(!document.onmousemove){ <BR>document.onmousemove = function(){ <BR>bb.style.left=event.clientX-offLX; //Set the X coordinate of block <BR>bb. style.top=event.clientY-offLY; //Set the Y coordinate of the block <BR>} <BR>} <BR>} <BR>document.onmouseup = function(){document.onmousemove = null;} //Mouse Bounce<BR></script>