I’m working on something for a website when you click their name it brings down options, i got it once but i want the options box to appear where the mouse is at the time of the click so i tried making it like this…
<script>
function show(szDivID, iState)
{
ms_x = event.x+document.body.scrollLeft;
ms_y = event.y+document.body.scrollTop;
if(document.layers) //NN4+
{
document.layers[szDivID].visibility = iState ? “show” : “hide”;
}
else if(document.getElementById) //gecko(NN6) + IE 5+
{
var obj = document.getElementById(szDivID);
obj.style.visibility = iState ? “visible” : “hidden”;
}
else if(document.all) // IE 4
{
document.all[szDivID].style.visibility = iState ? “visible” : “hidden”;
}
}
document.all[szDivID].style.top = ms_y
document.all[szDivID].style.left = ms_x
<div ID=’the’ style=’visibility:visible;position:absolute;’>
<table align=’center’ bgcolor=’#454545′ border=’1′>
<tr>
<td>
Test
</td>
</tr>
</table>
</div>
</script>
It’s just not working though ?