Click to See Complete Forum and Search --> : iframes and swap image


spamtwo
12-03-2002, 10:55 AM
Hello,

I have an HTML document that contains an iframe and from it I want to change an image in the main document. The image name is "section_header". Is this possible and if so can someone tell me how.

Cheers
Mark

gil davis
12-03-2002, 11:38 AM
window.top.document.images["section_header"].src = "someother.gif";

spamtwo
12-03-2002, 12:03 PM
thanks for the reply, but I'm confused, where do I put this script? Do I just add an onClick event or does it go in the head?

cheers
Mark

gil davis
12-03-2002, 01:08 PM
as to how to swap an image in the first place?

When would you swap the image?

Do you need a "whole script"? Your question did not seem to indicate the amount of assistance required.

spamtwo
12-03-2002, 01:15 PM
sorry about the confusion I've caused, what I want to do is swpa the image when I click on a button that is within the iframe.

hope this now makes sense

Mark

gil davis
12-03-2002, 02:19 PM
What do you consider a button?

spamtwo
12-03-2002, 02:24 PM
i'm using an image as the button

gil davis
12-03-2002, 02:25 PM
Please post the *exact* HTML that you want to trigger the flip.