Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
mNo edit summary
mNo edit summary
Line 144: Line 144:
mouseY = e.clientY + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
mouseY = e.clientY + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
}
}
moveTooltip(mouseX, mouseY, e);
moveTooltip(mouseX, mouseY);
}
}
function moveTooltip(x, y, e) {
function moveTooltip(x, y) {
if(_activeTooltipIdx != -1) {
if(_activeTooltipIdx != -1) {
var parentObj = document.getElementById('tooltipframeidx-' + _activeTooltipIdx);
var parentObj = document.getElementById('tooltipidx-' + _activeTooltipIdx);
parentObj.style.left = (x - _posCorrectionX) + 'px'; //500
var parentPos = findPos(parentObj);
parentObj.style.top = (y - _posCorrectionY) + 'px'; //105
var frameObj = document.getElementById('tooltipidx' + _activeTooltipIdx);
frameObj.style.left = (x - parentPos.curleft) + 'px'; //500
frameObj.style.top = (y - parentPos.curtop) + 'px'; //105
}
}
return false;
return false;
}
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
}
function showTooltip(id) {
function showTooltip(id) {