为什么我的getPosition(node).left返回的是NaN呢?
function getPosition(node){ //获取元素距离屏幕的距离
var left = node.offsetLeft;
var top = node.offsetTop;
var parent = node.offsetParent;
while(parent!=null){
left += parent.offsetLeft;
top += parent.offsetTop;
parent = parent.offsetLeft;
}
return {"left":left,"top":top};
}