IndustriousBird
Technical User
I am trying to create 4 separate text hovers that cause the same image to change. There are 5 images total- the main image, plus the other four that correspond to each text link. Basically, I have a stylized image of four people. My goal is that each person's image should come to the forefront when their name is moused over on a different part of the page. I found a script that works- but I don't know how to make it work 3 more times! I want to add three more images. Does anyone know how to do this? Any help would be greatly appreciated! Here is the code i have so far.., (with the script working for the first image...) The other three images that I want to add are called
"img/neon_greg.jpg"
"img/neon_steve.jpg"
"img/neon_dillon.jpg"
each of these images would correspond to their relative text links.. ie) "img/neon_dillon" should show up when a user mouses over the words "Dillon Westbrook!"
---------------
<script language="JavaScript">
<!-- Hide the script from old browsers --
img0_on = new Image();
img0_on.src="img/neon_justine.jpg";
img0_off = new Image();
img0_off.src="img/neon_vermouth.jpg";
function over_image(parm_name)
{
document[parm_name].src = eval(parm_name + "_on.src"
;
}
function off_image(parm_name)
{
document[parm_name].src = eval(parm_name + "_off.src"
;
}
// End Hiding Here -->
</script>
</head>
<body bgcolor="000000">
<table border="0" cellpadding="0" cellspacing="0" align="center" width="500" height="382" background="img/players_page.jpg">
<tr>
<td width="41" height="0"><img src="img/x.gif" width="41" height="1" border="0"></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="418" height="165">
<tr bgcolor="#000000">
<td width="15" height="1"><img src="img/x.gif" width="10" height="1" border="0"></td>
<td colspan="2" width="400" height="164"><img src="img/neon_vermouth.jpg" name="img0" width="400" height="164" border="0"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="5" align="center" width="418" height="177">
<tr>
<td colspan="3" align="center"><span class="heading">Vermouth is...</span></td>
</tr>
<tr>
<td width="30" height="1"><img src="img/x.gif" width="30" height="1" border="0"></td>
<td width="175" valign="top"><a href="players.html" onmouseover="over_image('img0');"
onmouseout="off_image('img0')" class="songtitle">Justine Kragen</a></td>
<td valign="top"><span class="content">Vocals/Guitar/Bass</span></td>
</tr>
<tr>
<td width="5" height="1"><img src="img/x.gif" width="5" height="1" border="0"></td>
<td width="175" valign="top"><span class="heading">Steve McDonald</span></td>
<td valign="top"><span class="content">Guitar/Bass</span></td>
</tr>
<tr>
<td width="5" height="1"><img src="img/x.gif" width="5" height="1" border="0"></td>
<td width="175" valign="top"><span class="heading">Greg Weber</span></td>
<td valign="top"><span class="content">Trumpet/Guitar/Bass/Vocals</span></td>
</tr>
<tr>
<td width="5" height="1"><img src="img/x.gif" width="5" height="1" border="0"></td>
<td width="175" valign="top"><span class="heading">Dillon Westbrook</span></td>
<td valign="top"><span class="content">Drums/Vocals</span></td>
</tr>
<tr>
<td width="1" height="20"><img src="img/x.gif" width="1" height="20" border="0"></td>
</tr>
</table>
</td>
<td width="40" height="0"><img src="img/x.gif" width="40" height="1" border="0"></td>
</tr>
</table>
"img/neon_greg.jpg"
"img/neon_steve.jpg"
"img/neon_dillon.jpg"
each of these images would correspond to their relative text links.. ie) "img/neon_dillon" should show up when a user mouses over the words "Dillon Westbrook!"
---------------
<script language="JavaScript">
<!-- Hide the script from old browsers --
img0_on = new Image();
img0_on.src="img/neon_justine.jpg";
img0_off = new Image();
img0_off.src="img/neon_vermouth.jpg";
function over_image(parm_name)
{
document[parm_name].src = eval(parm_name + "_on.src"
}
function off_image(parm_name)
{
document[parm_name].src = eval(parm_name + "_off.src"
}
// End Hiding Here -->
</script>
</head>
<body bgcolor="000000">
<table border="0" cellpadding="0" cellspacing="0" align="center" width="500" height="382" background="img/players_page.jpg">
<tr>
<td width="41" height="0"><img src="img/x.gif" width="41" height="1" border="0"></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="418" height="165">
<tr bgcolor="#000000">
<td width="15" height="1"><img src="img/x.gif" width="10" height="1" border="0"></td>
<td colspan="2" width="400" height="164"><img src="img/neon_vermouth.jpg" name="img0" width="400" height="164" border="0"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="5" align="center" width="418" height="177">
<tr>
<td colspan="3" align="center"><span class="heading">Vermouth is...</span></td>
</tr>
<tr>
<td width="30" height="1"><img src="img/x.gif" width="30" height="1" border="0"></td>
<td width="175" valign="top"><a href="players.html" onmouseover="over_image('img0');"
onmouseout="off_image('img0')" class="songtitle">Justine Kragen</a></td>
<td valign="top"><span class="content">Vocals/Guitar/Bass</span></td>
</tr>
<tr>
<td width="5" height="1"><img src="img/x.gif" width="5" height="1" border="0"></td>
<td width="175" valign="top"><span class="heading">Steve McDonald</span></td>
<td valign="top"><span class="content">Guitar/Bass</span></td>
</tr>
<tr>
<td width="5" height="1"><img src="img/x.gif" width="5" height="1" border="0"></td>
<td width="175" valign="top"><span class="heading">Greg Weber</span></td>
<td valign="top"><span class="content">Trumpet/Guitar/Bass/Vocals</span></td>
</tr>
<tr>
<td width="5" height="1"><img src="img/x.gif" width="5" height="1" border="0"></td>
<td width="175" valign="top"><span class="heading">Dillon Westbrook</span></td>
<td valign="top"><span class="content">Drums/Vocals</span></td>
</tr>
<tr>
<td width="1" height="20"><img src="img/x.gif" width="1" height="20" border="0"></td>
</tr>
</table>
</td>
<td width="40" height="0"><img src="img/x.gif" width="40" height="1" border="0"></td>
</tr>
</table>