supersal666
Programmer
Hi everyone I have a javascript hover over html pop up. All works fine apart from that when I try to set the position of the pop up it just stays in the top left corner. Can anyone see any error in the code that I cannot.
<script type="text/javascript">
function ShowPopup(hoveritem)
{
hp = document.getElementById("hoverpopup");
// Set position of hover-over popup
hp.style.top = hoveritem.offsetTop + 18;
hp.style.left = hoveritem.offsetLeft + 20;
// Set popup to visible
hp.style.visibility = "Visible";
}
function HidePopup()
{
hp = document.getElementById("hoverpopup");
hp.style.visibility = "Hidden";
}
</script>
<table border="0" class="tableIdle" onmouseover="this.className='tableActive'" onmouseout="this.className='tableIdle'" onclick="location.href=' <tr>
<a id="hoverover" style="cursor:default;" onMouseOver="ShowPopup(this);" onMouseOut="HidePopup();"><td><span style="color:#ffffff;background-color:#ff0000;padding:3px;"> Please Try: </span></td>
<td>Reports Under Development</td></a>
</tr>
</table>
<div id="hoverpopup" style="visibility:hidden; position:absolute; top:0; left:200;">
<table bgcolor="#0000FF">
<tr><td><font color="#FFFFFF">During Login, ensure the domain name TOPPSHODOM</font></td></tr>
<tr><td bgcolor="#8888FF">is provided with your login name. e.g. domain\login name</td></tr>
</table>
</div>
Any ideas?
Thanks
Sally
<script type="text/javascript">
function ShowPopup(hoveritem)
{
hp = document.getElementById("hoverpopup");
// Set position of hover-over popup
hp.style.top = hoveritem.offsetTop + 18;
hp.style.left = hoveritem.offsetLeft + 20;
// Set popup to visible
hp.style.visibility = "Visible";
}
function HidePopup()
{
hp = document.getElementById("hoverpopup");
hp.style.visibility = "Hidden";
}
</script>
<table border="0" class="tableIdle" onmouseover="this.className='tableActive'" onmouseout="this.className='tableIdle'" onclick="location.href=' <tr>
<a id="hoverover" style="cursor:default;" onMouseOver="ShowPopup(this);" onMouseOut="HidePopup();"><td><span style="color:#ffffff;background-color:#ff0000;padding:3px;"> Please Try: </span></td>
<td>Reports Under Development</td></a>
</tr>
</table>
<div id="hoverpopup" style="visibility:hidden; position:absolute; top:0; left:200;">
<table bgcolor="#0000FF">
<tr><td><font color="#FFFFFF">During Login, ensure the domain name TOPPSHODOM</font></td></tr>
<tr><td bgcolor="#8888FF">is provided with your login name. e.g. domain\login name</td></tr>
</table>
</div>
Any ideas?
Thanks
Sally