...

View Full Version : On hover hyperlink change image



Kal
10-19-2006, 11:11 AM
Hi,

can anyone help with a script which will change an image in a different frame when you hover over a link in a navigation frame.

i have mamanged to get the images to change within the same frame, but having trouble changing it within another frame. the code is below.


<FRAMESET COLS="5%,*,5%">

<FRAME NAME="left_white" SCROLLING="no" NORESIZE>

<FRAMESET ROWS="65,*,25">

<FRAME NAME="header" SCROLLING="no" NORESIZE>

<FRAMESET COLS="153,756,153">
<FRAME NAME="left" SCROLLING="no" SRC="left.html" NORESIZE TARGET="main">
<FRAME NAME="main" SRC="main.html">
<FRAME NAME="right" SCROLLING="no" NORESIZE>

</FRAMESET>

<FRAME NAME="bottom" SCROLLING="no" NORESIZE>

<!--<NOFRAMES>

<BODY>
<P>This page uses frames, but your browser doesn't support them.</P>
</BODY>

</NOFRAMES>-->

</FRAMESET>

<FRAME NAME="right_white" SCROLLING="no" NORESIZE>

</FRAMESET>


<img name="main_image" src="images/pink.jpg"
border=0 alt="Rollover Image" width="100" height="100">

<p>

<a href="#"
onmouseover='main_image.src = "images/red.jpg";rollover1.src="images/ltred.jpg"'
onmouseout='main_image.src="images/pink.jpg";rollover1.src="images/red.jpg"'>
Hyperlink 1</a>
&nbsp;

<a href="#"
onmouseover='main_image.src = "images/green.jpg";rollover2.src="images/ltgreen.jpg"'
onmouseout='main_image.src="images/pink.jpg";rollover2.src="images/green.jpg"'>
Hyperlink 2</a>
&nbsp;

<a href="#"
onmouseover='main_image.src = "images/blue.jpg";rollover3.src="images/ltblue.jpg"'
onmouseout='main_image.src="images/pink.jpg";rollover3.src="images/blue.jpg"'>
Hyperlink 3</a>
&nbsp;

thanks in advance.

A1ien51
10-19-2006, 03:38 PM
parent.framename.getElementById("asdf").src = 'foo.bar';

Kal
10-19-2006, 04:48 PM
Cheers mate, just sorted it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum