MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 70: | Line 70: | ||
var left = parseInt(window.getComputedStyle(e.target).left); | var left = parseInt(window.getComputedStyle(e.target).left); | ||
var bodyTop = document.body.getBoundingClientRect().top; | var bodyTop = document.body.getBoundingClientRect().top; | ||
var top = parseInt(window.getComputedStyle(e.target).top); | var top = parseInt(window.getComputedStyle(e.target).top); | ||
console.log(top, bodyTop, top - bodyTop); | |||
e.target.style.left = left - bodyLeft + 'px'; | e.target.style.left = left - bodyLeft + 'px'; | ||
e.target.style.top = top - bodyTop + 'px'; | e.target.style.top = top - bodyTop + 'px'; | ||