X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=js%2Futils.js;h=f4a4f65cc0f4717af7a14d434325566bf0f018d5;hb=25af3af4a289237f515137684b72b224d80b8ca0;hp=25b6e19a70a59b23611ffb509e581bfd6624fca2;hpb=905860a67c90a0bbf377e2a81e14d668b553fa30;p=fa-stable.git diff --git a/js/utils.js b/js/utils.js index 25b6e19a..f4a4f65c 100644 --- a/js/utils.js +++ b/js/utils.js @@ -275,9 +275,10 @@ function element_pos(e) { var offsetParent = e.offsetParent; var parentNode = e.parentNode; - while (offsetParent !== null) { + while (offsetParent !== null && offsetParent.style.display != 'none') { res.x += offsetParent.offsetLeft; res.y += offsetParent.offsetTop; + // the second case is for IE6/7 in some doctypes if (offsetParent != document.body && offsetParent != document.documentElement) { res.x -= offsetParent.scrollLeft; res.y -= offsetParent.scrollTop; @@ -296,6 +297,6 @@ function element_pos(e) { } } // parentNode has style.display set to none - if (parentNode!=document.documentElement) return null; + if (parentNode != document.documentElement) return null; return res; } \ No newline at end of file