Click to See Complete Forum and Search --> : Swap Images within Frames


chestertb
10-12-2003, 10:54 PM
I have a standard function which changes pictures, typically used as part of a mouseover routine...

function swapimage(imgname,reference)
{
imgName="referencename"
NewImg = eval(picture + '.src');
document[imgName].src = NewImg;
}

It is flexible enough to change any named image, so it gets used extensively on my page according to the construction of "picture" and "referencename".

I've now decided to introduce an <iframe name="content"> onto the page and want to click on an image in that iframe to change images on both my parent page and in the iframe.

In the iframe, I use href="javascript:top.function(value)", which calls a function in the parent and changes the images using the swapimage() function.

How do I reference the images in the iframe for change?

Thanks
IB

PS... It's taken a while, but I'm starting to get the hang of this JavaScript stuff.

lillu
10-13-2003, 05:12 AM
This should help:

http://www.faqts.com/knowledge_base/view.phtml/aid/5336/fid/127

chestertb
10-13-2003, 11:21 PM
thanks lillu. appreciate your assistance.