Click to See Complete Forum and Search --> : Frames and Menus Help


Albatross
04-13-2003, 04:50 PM
For the better part of a year, I have been working on a Classic BattleTech (http://www.classicbattletech.com) fan site, the Clan Wolf Archives (http://geocities.com/wolf_warrior_1/). I am currently working on updating my menu (with the hope of making it interactive), and I have run into a MAJOR snag.

First, please keep in mind that I have finished only the "main" "history" "society" and "government" files for the menu (the entire menu is a folder which contains a "menu" file for each of the files I have).

My problem is that whenever I click on the menu, the menu bar for the requisite file appears in the left frame (like it is supposed to), but the file itself does not appear in the right frame, unless I click on it again.

I am not sure what the problem is with my code, but I am wondering: is there a way to correct this to make both files upload in their respective frames with only a single click?

You may view my "test page" by clicking on

http://geocities.com/wolf_warrior_1/database/test.html

Any assistance on this matter will be greatly appreciated.

(btw, I had no idea where to place this thread, so if it's in the wrong board, please accept my most sincere apologies)

thevi
04-13-2003, 05:44 PM
maybe this is an obvious question, but did you design and code the menu yourself or is it created by some 3rd party package?

I also had the same problem that you described when I visited your test site.

AdamGundry
04-14-2003, 02:36 AM
You need Javascript in order to change two frame pages at once. Try this function (untested):

function go(targ1, targ2){
window.top.leftframe.location = targ1;
window.top.rightframe.location = targ2;
}


Then, in each of your links:
<a href="http://geocities.com/wolf_warrior_1/mainarea.html" target="right frame" a target="_self" href="http://geocities.com/wolf_warrior_1/directory/index.html" onmouseover="window.status='Main'; return true">Main</a>

becomes
<a href="#" onclick="go('http://geocities.com/wolf_warrior_1/directory/index.html','http://geocities.com/wolf_warrior_1/mainarea.html');">Main</a>

Hope this helps

Adam

P.S. Remember this will fail for 1 in 10 users.

Albatross
04-14-2003, 12:01 PM
Ah, thanks. I had a feeling I had to use JavaScript for it, but I was not entirely sure. Hence my reason for publishing my post in this thread.

(And I know it will fail for 1 in 10 users--that is a proven fact ;) )

Thanks for the assistance though!

I'll post an update when it is finished. :D

~Albatross~

Albatross
04-14-2003, 12:51 PM
Originally posted by AdamGundry
You need Javascript in order to change two frame pages at once. Try this function (untested):

function go(targ1, targ2){
window.top.leftframe.location = targ1;
window.top.rightframe.location = targ2;
}


Stupid Question: Where (in what file) does the above code go?

Originally posted by AdamGundry
becomes
<a href="#" onclick="go('http://geocities.com/wolf_warrior_1/directory/index.html','http://geocities.com/wolf_warrior_1/mainarea.html');">Main</a>

Hope this helps

Adam

P.S. Remember this will fail for 1 in 10 users.
Second, where would the onmouseover="window.status='LINK DESCRIPTION'; return true" command fit in the new link code? And what's up with the # sign?

~Albatross~
(Proud student of the "School of Hard Knocks" :cool: )

AdamGundry
04-14-2003, 02:00 PM
Where (in what file) does the above code go?
In between <script> tags in every file which calls the go() function, i.e. all of your left frame menu pages. Alternatively, place it in an external JS file then link it using the following:
<script type="text/javascript" src="filename.js"></script>

The onmouseover code goes before the closing > sign of the <a> tag, like below:
<a href="#" onclick="go('http://geocities.com/wolf_warrior_1/directory/index.html','http://geocities.com/wolf_warrior_1/mainarea.html');" onmouseover="window.status='LINK DESCRIPTION'; return true">Main</a>

The hash sign (#) prevents the browser from doing anything if Javascript is not enabled, by sending the user to an unnamed location on the current page.

Adam

P.S. I forgot to mention, you need to change your frame names from 'left frame' and 'right frame' to 'leftframe' and 'rightframe' respectively in your frameset document.

Albatross
04-14-2003, 02:30 PM
Okay. Main file is done, and the frame definitions (leftframe and rightframe) were changed, but now I am getting "Error: Line 2, Character 290 syntax error Code 0" messages. Could this be simply because the other menu files are not done yet, or could there be a problem?

(And thank you for the help! :D)

AdamGundry
04-14-2003, 03:00 PM
I've looked at your site, and I'm guessing the syntax error is due to incorrect Geocities code - I've had a similar problem before. I don't know what you can do about that, other than find a better host. I can't see anything in the new code that should cause a problem, but there could be a mistake somewhere.

Adam

Albatross
04-14-2003, 03:08 PM
Okay. Well, I just got the Government file finished (first in the file manager), and I keep getting "Unterminated String Constant" errors whenever I click on that link. Is there a way to correct that as well, or is it GeoCities' incorrect code?

This is what I am getting thus far:

Line: 22
Char: 33
Error: Unterminated string constant
Code: 0
URL: http://geocities.com/wolf_warrior_1/directory/government.html