perfectdesign
Programmer
I've been working on a script to control popup images on the onMouseOver event. The script works as far as producing a popup but I'm have trouble making the popup images unique to the name that is suppose to produce the event. Right now, when the images popup they are all the same, regardless of how it is coded.
For referance: (just mouse over the players last name for the popup).
This is the script:
And this is the html:
I've been working on this one page for days now and I just can't get it to work.
For referance: (just mouse over the players last name for the popup).
This is the script:
Code:
<script type="text/javascript">
function ShowPopup(hoveritem)
{
hp = document.getElementById("hoverpopup");
var node = hoveritem;
var x = 175;
var y = -115;
while ( node !== null )
{
x += node.offsetLeft;
y += node.offsetTop;
node = node.offsetParent;
}
// Set position of hover-over popup
hp.style.top = y + 'px';
hp.style.left = x + 'px';
//Set popup to visible
hp.style.visibility = "visible";
}
function HidePopup()
{
hp = document.getElementById("hoverpopup");
hp.style.visibility = "hidden";
}
</script>
And this is the html:
Code:
<tr>
<td width="49%" align="right">
<a href="bio/amentbio.php" target="_blank" onClick="window.open('bio/amentbio.php','Ryan Ament Bio','height=431,width=649,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); return false;">
Ryan
</a>
</td>
<td width="2%"> </td>
<td width="49%" align="left">
<a class="hoverover" style="cursor:default;" onMouseOver="ShowPopup(this);" onMouseOut="HidePopup();" href="bio/amentbio.php" target="_blank" onClick="window.open('bio/amentbio.php','Ryan Ament Bio','height=431,width=649,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); return false;">
Ament
</a>
<div id="hoverpopup" style="visibility:hidden; position:absolute;"><img src="bio/amentthumb.png" alt="Ryan Ament popup"></div>
</td>
</tr>
<tr>
<td align="right">
<a href="bio/atkinsonbio.php" target="_blank" onClick="window.open('bio/atkinsonbio.php','Steven Atkinson Bio','height=431,width=649,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); return false;">
Steven
</a>
</td>
<td> </td>
<td align="left">
<a class="hoverover" style="cursor:default;" onMouseOver="ShowPopup(this);" onMouseOut="HidePopup();" href="bio/atkinsonbio.php" target="_blank" onClick="window.open('bio/atkinsonbio.php','Steven Atkinson Bio','height=431,width=649,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); return false;">
Atkinson
</a>
<div id="hoverpopup" style="visibility:hidden; position:absolute; top:100px; left:350px;"><img src="bio/atkinsonthumb.png" alt="Steven Atkinson popup"></div>
</td>
</tr>
I've been working on this one page for days now and I just can't get it to work.