jesperthor
Technical User
Hello, I’m trying to add ‘Tool-tip’ to my images. I have one problem though. If you look at and rollover the first image a fancy “tip” will be displayed exactly where the courser are at the time. But if use the mousewheel (or the scrollbars to scroll down to the second image, the tip will displayed on wrong X & Y coordinates. I tired a different script called “overlib” and have the same result. It didn’t help that the overlibscript was in +1300 rows of code. This is the js code:
function showInfo(msg)
{
var X,Y
X = event.clientX;
Y = event.clientY;
document.all["info"].style.left = X;
document.all["info"].style.top = Y;
document.all["info"].innerHTML = msg;
document.all["info"].style.visibility = "visible";
}
And HTML:
<img src="knuff.gif" width="384" height="512" onmousemove="showInfo('detta är en paragraf<br> Paragrafer är stycken i en text<p>Paragrafer är bra')" onmouseout="document.all['info'].style.visibility = 'hidden'">
<div id="info" style="visibility:hidden"/>
Thanks for your time!
function showInfo(msg)
{
var X,Y
X = event.clientX;
Y = event.clientY;
document.all["info"].style.left = X;
document.all["info"].style.top = Y;
document.all["info"].innerHTML = msg;
document.all["info"].style.visibility = "visible";
}
And HTML:
<img src="knuff.gif" width="384" height="512" onmousemove="showInfo('detta är en paragraf<br> Paragrafer är stycken i en text<p>Paragrafer är bra')" onmouseout="document.all['info'].style.visibility = 'hidden'">
<div id="info" style="visibility:hidden"/>
Thanks for your time!