Fixed localx/localy calculation

This commit is contained in:
Barry Silverman 2010-09-18 14:04:52 -04:00
parent 1fd86334f7
commit 6276d019d7
1 changed files with 2 additions and 8 deletions

View File

@ -306,19 +306,13 @@ function setChipStyle(props){
function localx(el, gx){
var lx = gx+window.pageXOffset;
while(el.offsetLeft!=undefined){
lx-=el.offsetLeft+el.clientLeft;
el = el.parentNode;
}
lx-=el.getBoundingClientRect().left
return lx;
}
function localy(el, gy){
var ly = gy+window.pageYOffset;
while(el.offsetTop!=undefined){
ly-=el.offsetTop+el.clientTop;
el = el.parentNode;
}
ly-=el.getBoundingClientRect().top
return ly;
}