PDA

View Full Version : Changing an image from another frame


IK200
09-11-2002, 04:35 PM
Howdy...

Scenario:

2 Frames. When the user goes to a specific page in the site, the main frame must tell an image in the top frame to change to another image. (Not a random image, but a specific one.)


How do I do this?


Thanks (In advance :) )

Ökii
09-11-2002, 04:52 PM
<script language="javascript">
top.framename.images['imagename'].src = 'newimage.jpg';
</script>

IK200
09-12-2002, 07:38 AM
Hi

Will give it a try.

Thanks.

IK200
09-12-2002, 08:05 AM
Howdy....

It doesn't seem to want to work...
Any ideas?

Cheers

glenngv
09-12-2002, 09:17 AM
did you change to appropriate frame and image names?

<script language="javascript">
top.framename.images['imagename'].src = 'newimage.jpg';
</script>

IK200
09-12-2002, 09:43 AM
Howdy

Yip. I did.

<script language="javascript">
top.navig.images['pic01'].src = 'images/logo.jpg';
</script>

I placed this script in my bottom frame, and nothing happens.

It needs to change the pic in the top frame as soon as the bottom frame loads.

glenngv
09-12-2002, 09:54 AM
top.navig.document.images['pic01'].src = 'images/logo.jpg';

IK200
09-12-2002, 10:11 AM
Howdy...

Thanks so much. It works after I added in the .document part....

Thanks again...