More actions
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 | moveTooltip(mouseX, mouseY); | ||
} | } | ||
function moveTooltip(x, y | function moveTooltip(x, y) { | ||
if(_activeTooltipIdx != -1) { | if(_activeTooltipIdx != -1) { | ||
var parentObj = document.getElementById(' | var parentObj = document.getElementById('tooltipidx-' + _activeTooltipIdx); | ||
parentObj.style.left = (x - | var parentPos = findPos(parentObj); | ||
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) { | ||