Thanks again.
HTML Code:
<style type="text/css"> .draggableObj { position:relative; } </style>
<script type="text/javascript">
var isIE = document.all;
var isNN6=document.getElementById&&!document.all;
var bDragging=false;
var xPos,yPos;
var draggableObject;
function _mouseMove(e){
if (bDragging){
draggableObject.style.left = isNN6 ? txPos + e.clientX - xPos : txPos + event.clientX - xPos;
draggableObject.style.top = isNN6 ? tyPos + e.clientY - yPos : tyPos + event.clientY - yPos;
return false;
}
}
function _mouseSelect(e){
var focusedObject = isNN6 ? e.target : event.srcElement;
var topelement = isNN6 ? "HTML" : "BODY";
while (focusedObject.tagName != topelement && focusedObject.className != "draggableObj"){
focusedObject = isNN6 ? focusedObject.parentNode : focusedObject.parentElement;
}
if (focusedObject.className=="draggableObj"){
bDragging = true;
draggableObject = focusedObject;
txPos = parseInt(draggableObject.style.left+0);
tyPos = parseInt(draggableObject.style.top+0);
xPos = isNN6 ? e.clientX : event.clientX;
yPos = isNN6 ? e.clientY : event.clientY;
document.onmousemove=_mouseMove;
return false;
}
}
document.onmousedown=_mouseSelect;
document.onmouseup=new Function("bDragging=false");
</script>
and the html
HTML Code:
<div class="draggableObj">such and such</div>
Bookmarks