L
London Boy
Hi, i've done a script that makes a DIV appear and follow the mouse cursor and it works
fine but, it has a small glitch, when i scroll the document, the DIV doesn't appear
beside the cursor but much higher on the page.
In the function that shows the DIV for the first time, the document.body.scroll...
doesn't work, they always return 0, though it works on a website i visited... any
clues? (IE)
In the A tags of links -> onMouseOver="showToolTip('text to display');"
function showToolTip(tipText) {
var MouseX=event.clientX+document.body.scrollLeft+10;
var MouseY=event.clientY+document.body.scrollTop+10;
document.all.ToolTipText.innerHTML= tipText;
document.all.ToolTipText.style.top=MouseY;
document.all.ToolTipText.style.left=MouseX;
document.all.ToolTipText.style.visibility="visible";
}
Any help would be appreciated.
fine but, it has a small glitch, when i scroll the document, the DIV doesn't appear
beside the cursor but much higher on the page.
In the function that shows the DIV for the first time, the document.body.scroll...
doesn't work, they always return 0, though it works on a website i visited... any
clues? (IE)
In the A tags of links -> onMouseOver="showToolTip('text to display');"
function showToolTip(tipText) {
var MouseX=event.clientX+document.body.scrollLeft+10;
var MouseY=event.clientY+document.body.scrollTop+10;
document.all.ToolTipText.innerHTML= tipText;
document.all.ToolTipText.style.top=MouseY;
document.all.ToolTipText.style.left=MouseX;
document.all.ToolTipText.style.visibility="visible";
}
Any help would be appreciated.