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