遍历父元素获得元素在文档中的绝对坐标
function getAbsPoint(e)
{//对象在文档中的绝对坐标
var x = e.offsetLeft,y = e.offsetTop;
while(e = e.offsetParent)
{
x += e.offsetLeft;
y += e.offsetTop;
}
return [x,y];
}
遍历父元素获得元素在文档中的绝对坐标
function getAbsPoint(e)
{//对象在文档中的绝对坐标
var x = e.offsetLeft,y = e.offsetTop;
while(e = e.offsetParent)
{
x += e.offsetLeft;
y += e.offsetTop;
}
return [x,y];
}