Я пробовал вот так:
var x = document.getElementById("PosX"),
y = document.getElementById("PosY"),
el = document.getElementById("detect"),
xe = document.getElementById("pods");
el.onmousedown = function(e){
e.style.position = "relative";
el.onmousemove = function(e){
if(!e) e = event
x.value = e.offsetX;
y.value = e.offsetY;
//xe.style.position = "relative";
xe.style.left = x.value+"px";
xe.style.top = e.offsetY+"px";
}
}
el.onmouseout = function(){
xe.style.position = "absolute";
}
|