projects
/
infodrom.org
/
service.infodrom.org
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
beacc27
)
Adjust centering of objects when page is scrolled
author
Joey Schulze
<joey@infodrom.org>
Mon, 4 Jun 2018 18:23:29 +0000
(20:23 +0200)
committer
Joey Schulze
<joey@infodrom.org>
Sat, 6 Oct 2018 17:30:26 +0000
(19:30 +0200)
src/infodrom.js
patch
|
blob
|
history
diff --git
a/src/infodrom.js
b/src/infodrom.js
index
6325fc0
..
11e5db1
100644
(file)
--- a/
src/infodrom.js
+++ b/
src/infodrom.js
@@
-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");