PDA

View Full Version : target multiple frames via one link ...



des55
Nov 27th, 2005, 09:12 PM
My goal is to have a simple navigation/menu at the top of the site, where depending on a selection from the navigation (in most cases by selection) the selection would pull up or "call up" a theme image in window A or IFRAME A, which resides side by side to window B or IFRAME B which will also populate at the same time with content to coincide with the theme image (IFRAME A).

Basically I want to encapsulate all the content with a certain sizing of the browser window ... IFRAME A would stay static and would not scroll in any direction so the theme image would stay resident and visible next to IFRAME B which may--or may not require vertical scrolling.

I certainly hope this makes sense and would welcome any thoughts, opinions, pointer and/or straight up code snippets--web sites for reference. As always thanks in advance for all/any help you can provide!

| nav link - nav link - nav link - nav link - nav link |

|-------------------| |------------------------------|

..........IFRAME A..........................IFRAME B

|-------------------| |------------------------------|

_Aerospace_Eng_
Nov 27th, 2005, 10:16 PM
<script type="text/javascript">
function changeFrm(url){
parent.iframeBname.location=url;
}
</script>
Add the above in your head tags in your navigation page. Then your links would look something like this.

<a href="page1.html" target="iframeAname" onclick="changeFrm('page2.html')">Link1
You should make the more important page the href value just in case JS is disabled.

des55
Nov 27th, 2005, 10:59 PM
I will give it a run ... and thanks so much! One thought or perhaps question to further this discussion ....

I have never been a big fan of frame usage whatsoever, so that is why I have asked what may be a simple or perhaps dumb question, but I would like to know your thoughts--and others ... would you recommend perhaps writing to multiple DIV TAGS versus multiple IFRAMES?

I believe the usage of DIV TAGS in the original scenario that I questioned would be "safer"--regardless, would you be so kind to lend me your thoughts and expertise in a sample snippet?

Thanks again for your help!!!