This is a small script to display a floating box that follows the mouse when the mouse is over a link, but it only brings up the box and doesnt follow the mouse.. If ya get me.
[code]
var tid = 0, x = 0, y = 0;
document.onmousemove=track;
function track(e)
{
x = (document.all) ? event.x : e.pageX;
y = (document.all) ? event.y : e.pageY;
}
function show(id)
{
obj = document.getElementById(“popup” +id);
obj.style.left = x – 20; / /Error: obj has no properties . It’s weird, it only errors on this line of code
but manages to retrieve all the rest of the data from the object,
like the one below.
obj.style.top = y – 45;
obj.style.display = “block”;
tid = window.setTimeout(“show()”,1);
}
function hide(id)
{
obj = document.getElementById(“popup” +id);
window.clearTimeout(tid);
obj.style.display = “none”;
}
The code should work, as when the getelementbyid line is outside of the function it works perfectly ? Anybody help out a noob?? Pleeease.