#ghost {
border:2px dashed #990000;
position:absolute;
display:none;
top:0px;
left:0px;
margin-bottom:10px;
}
-------------------------------------------
-drag.js
-----------
if (typeof getElementById!="function") {
var getElementById = function (id) {
if (typeof(id)=="object") return id;
if (document.getElementById(id)) { return document.getElementById(id); }
else { throw new Error(id +" argument error, can not find \"" +id+ "\" element"); }
}
}
// 获取一个element的offset信息,其实就是相对于Body的padding以内的绝对坐标
function getElCoordinate (e) {
var t = e.offsetTop;
var l = e.offsetLeft;
var w = e.offsetWidth;
var h = e.offsetHeight;
while (e=e.offsetParent) {
t += e.offsetTop;
l += e.offsetLeft;
}; return {
top: t,
left: l,
width: w,
height: h,
bottom: t+h,
right: l+w
}
}