function getLeftPos(elm){
var left = 0;
while(elm){
left += elm.offsetLeft;
elm= elm.offsetParent;
}
return left;
}
How come this doesn't work?
getLeftPos(document.getElementById("#frame"));
If I alert(elm) inside that function, it is NULL.