PDA

View Full Version : Menus, frames and framesets


Bodmins
08-12-2002, 02:40 PM
I have been trying to figure this one out for some time, and getting quite fed up.

I have a page consisting of two columned frames 'contents' and 'main'. Within main I have a frameset consisting of two rowed frames 'rtop' and 'rbottom'.

I have a javascript menu on 'contents' which pops out onto 'main', and works fine.

However when I try to get it top pop out onto the frame 'rbottom' wich is a frameset inside main, it doesn't work.

I have tried so many things, too many to mention. Any one come accross this before and are able to give some suggestions?

beetle
08-12-2002, 02:48 PM
Layers (i.e. anything positioned with a z-index) and frames don't go well together. Remember, each frame is a separate window object. For a layer to overlap all frames, it's source code would have to be in the top frameset page. I've never tried this and not even sure it works, since most browsers (that support frames) will ignore code not within the <frameset> tags.

Bodmins
08-12-2002, 02:59 PM
I am not using layers, my pop-out code is in each frame (ie in main and rbottom).

The code in the menu frame (which tells where the source code is) does not seem to recognise 'parent.rbottom' it only recognises 'main'.

I tried to do a refresh on the menu frame once rbottom was loaded, incase it did not find it because it was not loaded yet, but it still did not work.

Keep getting 'PF.MLoaded is not an object'.

mordred
08-12-2002, 03:03 PM
Does parent.main.rbottom bring any relief?

Bodmins
08-12-2002, 03:17 PM
Nope, still get the same error. Thanks for the suggestion though.

The only time that I dont get an error is when I use 'main', however, it just doesn't work. So it does not help me much.

mordred
08-12-2002, 03:24 PM
I must admit that I am slightly confused by your description how that javascript menu works across the frames, perhaps others feel the same way.
Can you post the relevant code and a structure of your frameset? That would help.

Bodmins
08-12-2002, 03:52 PM
Well was hoping to avoid this, because it is quite confusing as it is writen in perl (and data driven), but I will keep it simple and give you the output.

The starting point dev0.htm:

<html>
<head>
<title></title>
</head>
<frameset framespacing="0" border="false" frameborder=0 cols="160,*">
<frame name="contents" target="main" src="dev1.htm" scrolling="no" noresize>
<frame name="main" src="dev2.htm">
</frameset>
</html>

dev1.htm (simplified because it is really long):

<html>
<head>
<title></title>
addmenu(menu=[ // This is the array that contains your menu properties and details
"simplemenu1", // Menu Name - This is needed in order for the menu to be called
333, // Menu Top - The Top position of the menu in pixels
10, // Menu Left - The Left position of the menu in pixels
140, // Menu Width - Menus width in pixels
1, // Menu Border Width
, // Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
plain_style, // Properties Array - this is set higher up, as above
1, // Always Visible - allows the menu item to be visible at all time (1=on/0=off)
"left", // Alignment - sets the menu elements text alignment, values valid here are: left, right or center
effect, // Filter - Text variable for setting transitional effects on menu activation - see above for more info
, // Follow Scrolling Top Position - Tells the menu to follow the user down the screen on scroll placing the menu at the value specified.
, // Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style (1=on/0=off)
, // Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page (1=on/0=off)
, // Position of TOP sub image left:center:right
, // Set the Overall Width of Horizontal Menu to 100% and height to a specified amount
, // Right To Left - Used in Hebrew for example. (1=on/0=off)
, // Open the Menus OnClick - leave blank for OnMouseover (1=on/0=off)
, // ID of the div you want to hide on MouseOver (useful for hiding form elements)
, // Reserved for future use
, // Reserved for future use
, // Reserved for future use
// "Menu Item Text", "URL", "Alternate URL for submenu holders", "Status Text", "Separator Bar Width"
,"Calendars","show-menu=calendars source-frame=main",,"Calendars",1
,"Contacts","show-menu=contacts source-frame=main",,"Contacts",1
,"Address Book","show-menu=address source-frame=main",,"Address Book",1
])

dumpmenus() // This must be the last line in this file
// -->
</script>
<SCRIPT language="JavaScript" src="nav.js" type="text/javascript"></SCRIPT>
</head>
<body>

</body>
</html>

dev2.html (simplified) - this works:

<html>
<head>
<script>
addmenu(menu=["calendars",
,,135,1,"",plain_style,,,effect,,,,,,,,,,,,
,"Personal Diary", "cal.pl",,,1
,"rogcal", "cal.pl?CalendarName=rog",,,1
])
addmenu(menu=["contacts",
,,135,1,"",plain_style,,,effect,,,,,,,,,,,,
,"Students", "FrameC.pl?url=students.pl",,,1
,"Personal Students", "FrameC.pl?url=personal.pl",,,1
,"Administrator","FrameC.pl?url=contacts.pl",,,1
])
addmenu(menu=["Address Book",
,,135,1,"",plain_style,,,effect,,,,,,,,,,,,
,"Course Details", "cpm_enq.pl",,,1
,"Year Details", "enq.pl",,,1
])
</script>
</head>
<body>

</body>
</html>

dev3.htm:

<html>
<head>
<title></title>
</head>

<frameset framespacing="0" border="false" frameborder=0 rows="230,*">
<frame name="rtop" target="rbottom" src="dev4.htm" scrolling="no" noresize>
<frame name="rbottom" src="dev5.htm">
</frameset>
<script>
addmenu(menu=["calendars",
,,135,1,"",plain_style,,,effect,,,,,,,,,,,,
,"Personal Diary", "cal.pl",,,1
,"rogcal", "cal.pl?CalendarName=rog",,,1
])
addmenu(menu=["contacts",
,,135,1,"",plain_style,,,effect,,,,,,,,,,,,
,"Students", "FrameC.pl?url=students.pl",,,1
,"Personal Students", "FrameC.pl?url=personal.pl",,,1
,"Administrator","FrameC.pl?url=contacts.pl",,,1
])
addmenu(menu=["Address Book",
,,135,1,"",plain_style,,,effect,,,,,,,,,,,,
,"Course Details", "cpm_enq.pl",,,1
,"Year Details", "enq.pl",,,1
])
</script>
<script language=JavaScript src="menu.js" type=text/javascript></script>
</html>

dev5.htm:
<html>
<head>
<title></title>
<script>
addmenu(menu=["calendars",
,,135,1,"",plain_style,,,effect,,,,,,,,,,,,
,"Personal Diary", "cal.pl",,,1
,"rogcal", "cal.pl?CalendarName=rog",,,1
])
addmenu(menu=["contacts",
,,135,1,"",plain_style,,,effect,,,,,,,,,,,,
,"Students", "FrameC.pl?url=students.pl",,,1
,"Personal Students", "FrameC.pl?url=personal.pl",,,1
,"Administrator","FrameC.pl?url=contacts.pl",,,1
])
addmenu(menu=["Address Book",
,,135,1,"",plain_style,,,effect,,,,,,,,,,,,
,"Course Details", "cpm_enq.pl",,,1
,"Year Details", "enq.pl",,,1
])
</script>
<script language=JavaScript src="menu.js" type=text/javascript></script>
</head>
<body>

</body>
</html>


I hope the above makes vague sense!