diff --git a/static/js/auto-complete.js b/static/js/auto-complete.js index 3c184fba77..b7ddb77b7e 100644 --- a/static/js/auto-complete.js +++ b/static/js/auto-complete.js @@ -78,11 +78,11 @@ var autoComplete = (function(){ parentOffsetLeft = parentElement.getBoundingClientRect().left; parentOffsetTop = parentElement.getBoundingClientRect().top; } else { - pageXOffset = window.pageXOffset; - pageYOffset = window.pageYOffset; + pageXOffset = window.pageXOffset || document.documentElement.scrollLeft; + pageYOffset = window.pageYOffset || document.documentElement.scrollTop; } - that.sc.style.left = Math.round(rect.left + (pageXOffset || document.documentElement.scrollLeft) + o.offsetLeft - parentOffsetLeft) + 'px'; - that.sc.style.top = Math.round(rect.bottom + (pageYOffset || document.documentElement.scrollTop) + o.offsetTop - parentOffsetTop) + 'px'; + that.sc.style.left = Math.round(rect.left + pageXOffset + o.offsetLeft - parentOffsetLeft) + 'px'; + that.sc.style.top = Math.round(rect.bottom + pageYOffset + o.offsetTop - parentOffsetTop) + 'px'; that.sc.style.width = Math.round(rect.right - rect.left) + 'px'; // outerWidth if (!resize) { that.sc.style.display = 'block';