Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouseover using Frames

Status
Not open for further replies.

alexpalmbay

Technical User
Sep 1, 2002
6
US
I'm creating a website using three frames (menu, main, and banner). I need assistance in writing a script that will change the image on the banner frame, when the user moves the mouse over the links on the menu frame. I know how to change the image w/in the same frame, but that's not what I want.

Any guidance/assistance will be greatly appreciated.

Thanks,
Alex
 
You want to reference the common document. Both frames share the same parent document. Once you reference that parent, you can then reference any of the frames within it.

If the banner frame is name="banner" and it contains an image id="image", and the following link is in the navigation frame. uniqueID could be the url (or part) of the image you want displayed..


<a href=&quot;&quot; onmouseover=&quot;newImage('uniqueID')&quot;>Click me</a>

<script>
function newImage(url){
parent.banner.document.getElementById('image').src=url;
}
</script>

I think that works. Didn't test it though and it's late :p

----------
I'm willing to trade custom scripts for... [see profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top