How to swap images in another frame

  • Thread starter Thread starter awesterink
  • Start date Start date
A

awesterink

If I have a simple 3-frame design (frame_leftmenu, frame_topbar,
frame_page), how can I best obtain the following result when clicking a
button in the left menu:
- loading a new page in frame_page
- update a graphic in frame_topbar

I know I could create 2 nested framesets, and a have a menu click result in
a load of a new top AND page frame. But given that I am using a background
graphic in the top frame that blends into the menu graphic, I don't want to
see that top graphic disappear for a split-second while the top frame gets
refreshed. Basically, I want the top frame to stay loaded, but only swap an
image in it. Is that possible?
 
Hi Aweteink,

Yes it is possible by using the frames collection and the id of the image you can change the image source.

For example:

parent.frames['myframe'].images['myimage'].src = 'new.gif';
 
Thx for the reply. Where would I put this code?

I used the standard DHTML toolbar in Frontpage to create mouseover effects
for swapping images in the menu bar. It creates some inline DHTML code plus
the animate.js file. What I need to do now is:
a) hyperlink the button to the linked page, to be loaded in frame_page
b) update the image source in frame-top as soon as that linked page is
loaded in frame_page

So...do I put that code somewhere in the newly opened page?

MD Websunlimited said:
Hi Aweteink,

Yes it is possible by using the frames collection and the id of the image
you can change the image source.

For example:

parent.frames['myframe'].images['myimage'].src = 'new.gif';


--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 102 Components For FP
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible

awesterink said:
If I have a simple 3-frame design (frame_leftmenu, frame_topbar,
frame_page), how can I best obtain the following result when clicking a
button in the left menu:
- loading a new page in frame_page
- update a graphic in frame_topbar

I know I could create 2 nested framesets, and a have a menu click result
in a load of a new top AND page frame. But given that I am using a
background graphic in the top frame that blends into the menu graphic, I
don't want to see that top graphic disappear for a split-second while the
top frame gets refreshed. Basically, I want the top frame to stay loaded,
but only swap an image in it. Is that possible?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top