PDA

View Full Version : Mouseover through frames?


angryferret
01-13-2001, 03:39 AM
Hey, I was just wondering if anyone could help me with a problem I have. I've been trying to add a mouseover image on my navigation frame. I'd like to make it so when I move my mouse over the image on the nav frame it changes the image on the main right frame. I've got the code for mouseover images but I don't remember how to make it change an image in a different frame. Any help?

whkoh
01-14-2001, 04:32 AM
I don't use mouseover, but it should have the target="example".

------------------
Koh Wei Han
Network Engineer
Contact: whkoh@apexmail.com , whkoh@mailandnews.com , whkoh@020.co.uk

Jason
01-14-2001, 11:42 AM
This requires javascript. Topic moved from Graphics & Multimedia to Client Side Scripting.

------------------
Jason M. DesRoches
Co-Founder / Business Development
Big Resources Network (http://www.bigresources.com)
jason@bigresources.com
ICQ: 17947522

kdjoergensen
01-14-2001, 04:46 PM
Since Jason banned you to this area, let me try to help you:

to change an image in another frame you need to give the browser the 'directions' or the 'roadmap' from frameA to frameB.

example:
normal swap code (located in "frameA"):
<a href="link here" onmouseover="document.myimage.src = 'over.gif'" onmouseout="document.myimage.src = 'out.gif'"><img name="myimage" src="out.gif"></a>

Lets say that instead of "myimage" you want to swap another image "otherImage" in frameB.

See how it is done:
<a href="link here" onmouseover="parent.frameB.document.otherImage.src = 'over.gif'" onmouseout="parent.frameB.document.otherImage.src = 'out.gif'"><img name="myimage" src="mygif.gif"></a>

see first how we substituted otherImage for myimage. see secondly how we provided the 'path' to the image:
parent.frameB.document...
(as opposed to just document....).

If you want to make dual imageswap (that is swapping BOTH the image you mouseover AND the image in another frame :)

<a href="link here" onmouseover="parent.frameB.document.otherImage.src = 'over.gif'; document.myimage.src='high.gif'" onmouseout="parent.frameB.document.otherImage.src = 'out.gif'; document.myimage.src='low.gif'"><img name="myimage" src="low.gif"></a>

I have given some image names here, like low/high/over/out. you can just use your own.