Adjust centering of objects when page is scrolled
[infodrom.org/service.infodrom.org] / src / infodrom.js
index 6325fc0..11e5db1 100644 (file)
@@ -73,7 +73,7 @@ function make_editable(selector)
 
     $.fn.center = function () {
        this.css("position","absolute");
-       this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) +
+       this.css("top", Math.max(0, ((window.innerHeight - $(this).outerHeight()) / 2) +
                                 $(window).scrollTop()) + "px");
        this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) +
                                  $(window).scrollLeft()) + "px");