MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 88: | Line 88: | ||
document.querySelectorAll('.cog-box-inner a').forEach(function(link){ | document.querySelectorAll('.cog-box-inner a').forEach(function(link){ | ||
link.addEventListener('mouseover', function(event) { | link.addEventListener('mouseover', function(event) { | ||
var parentBox = this.closest('.cog-box-inner a'); | |||
if (parentBox) { | if (parentBox) { | ||
console.log(parentBox); | console.log(parentBox); | ||
var linkTop = parentBox.getBoundingClientRect().top + window.scrollY; | |||
var bodyTop = document.body.getBoundingClientRect().top + window.scrollY; | var bodyTop = document.body.getBoundingClientRect().top + window.scrollY; | ||
var top = parseInt(window.getComputedStyle(e.target).top); | var top = parseInt(window.getComputedStyle(e.target).top); | ||