Solved

Making two frames change with one click

Posted on 1998-06-20
14
189 Views
Last Modified: 2010-04-09
Hello,
My page is divided into four frames.  My main navigation bar is on the top with the main window the bottom right and the sub navigation bottom left.  How can I get the sub nav and the main frames to load something with a click on something on the main nav?  So click "Personal" in the main nav and have the personal nav load in the bottom left and the info load in the bottom right?
0
Comment
Question by:treyjeff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 4

Accepted Solution

by:
martinag earned 60 total points
ID: 1844301
You can use JavaScript:
<A HREF="javascript:parent.frames[2].location='personal.htm'; parent.frames[3].location='info.htm';">Personal</A>

There is a trickier version, and if you want me to post it I will.
0
 
LVL 1

Author Comment

by:treyjeff
ID: 1844302
Ok, if this works suppose one frame is called "main" and the other is called "nav".  How would the answer above help?  Like what would the above look like?
0
 
LVL 4

Expert Comment

by:martinag
ID: 1844303
Could you make an outline over your home page?
__________________
|                  |                    |
|________|_________|
|                  |                    |
|________|_________|
(May look strange, but it should be four frames)

Enter the name of all the frames.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:treyjeff
ID: 1844304
Ok,  I'll try this.

___________________________________________________________
| home   |                   mainnav                      |
|        |                                                |
|________|________________________________________________|
| subnav |                    main                      |        |        |                                              |
___________________________________________________________

Well it's something like that :)  I'm sure you get it.  The home frame always contains a little imap for returning to my main home page.  The maninav has links to mai sections of my page (personal, friends, etc.)  If someone clicks personal I was hoping that the sub menu would should under subnav and the main info stuff would appear under main.        
0
 
LVL 4

Expert Comment

by:martinag
ID: 1844305
Try this one:
<A HREF="javascript:parent.subnav.location='personal/menu.htm'; parent.main.location='personal/main.htm';">Personal</A>
0
 
LVL 1

Author Comment

by:treyjeff
ID: 1844306
I got a javascript error on the page.  I have uploaded the pages I'm working on to http://www.huron.net/~jlewis/pages.zip Index.htm is the main page and mainnav is where I was adding the code.
0
 
LVL 4

Expert Comment

by:martinag
ID: 1844307
Edit this line in index.htm:
<frame name="contents" target="main" scrolling="no" noresize src="subnav.htm">

It should look like this:
<frame name="subnav" target="main" scrolling="no" noresize src="subnav.htm">
0
 
LVL 1

Author Comment

by:treyjeff
ID: 1844308
I got a javascript error on the page.  I have uploaded the pages I'm working on to http://www.huron.net/~jlewis/pages.zip Index.htm is the main page and mainnav is where I was adding the code.
0
 
LVL 1

Author Comment

by:treyjeff
ID: 1844309
Ok, I did that as well as chane the rest of the frame names.  I clicked the link and the top frame changed.  I want the bottome left and the bottom right to change.  I have uploaded updated files to same spot.
0
 
LVL 4

Expert Comment

by:martinag
ID: 1844310
In mainnav.htm, you have to change "contents" to "subnav".
Then will the two frames update all right.

I don't know if this is a bug in Netscape or what, but in the same frame as your menu (mainnav) a new document will appear. Well it's hard to explain, but I have solved it like this:
<A HREF="javascript:parent.subnav.location='personal/menu.htm'; parent.main.location='personal/main.htm'; parent.mainnav.location='mainnav.htm'">Personal</A>

Hope this works (finally)!
0
 
LVL 1

Author Comment

by:treyjeff
ID: 1844311
Thanks a lot.  It worked and I hope it works going the other way too :)  I'm glad someone else is on the internet on weekends like me.
0
 
LVL 4

Expert Comment

by:martinag
ID: 1844312
And the grading..?
0
 
LVL 1

Author Comment

by:treyjeff
ID: 1844313
Hehe sorry about that :)  Excellent answer!
0
 
LVL 4

Expert Comment

by:martinag
ID: 1844314
Thank you!
Now I have reached the 5000 p. and will get a t-shirt. I hope...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Selected in an option list 13 27
Fix Form size HTML 16 31
email validation 9 50
Boolean 13 25
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question