|
Compile Properties: Cross-Frame Support (version Pro only) |
|
Menus and submenus are DHTML elements. Unfortunately, the DHTML specifications in some older browsers do not allow an object to be displayed outside its defined frame. Respectively, a menu is not able to open its submenus outside its assigned frame.
To account for this browser restriction we implemented a solution where the Main Menu appears on one frame and all its Submenus appear on another frame.
You can view an on-line demo on how to implement cross-frame menus at http://www.likno.com/demos.html
You can also view an actual cross-frame implementation at http://www.likno.com/examples/demo_frames.html
To use our solution on a framed web site you need to do the following steps:
STEP 1. Go to Tools-> Project Properties > Compile Properties and check the "Enable Cross-Frame Support" box. You will have to give two pieces of information:
"Frame Name where the Submenus will appear":
This is the name of the frame where the submenus will open (not the name of the html file that opens inside that frame!). A Wizard has been created to help you retrieve the proper name for your selected frame.
Example:
Let's assume the following Frameset Definition inside the source code of your home page:
<frameset framespacing="0" border="0" cols="171,*" frameborder="0">
<frame name="left" target="main" src="left_page.htm" scrolling="auto">
<frame name="main" src="main_page.htm" target="_self">
<noframes>
<body>
<p>You need a browser that supports frames to see this site </p>
</body>
</noframes>
</frameset>
Let's also assume that you want the Main Menu to appear on the left frame and its submenus on the main frame.
The proper value for the field "Frame Name where the Submenus will open" should therefore be: main (not main_page.htm !)
"Submenus Positioning Offset":
This field should only be used if your frameset has more than two frames and one of these frames affects the position of submenus relative to their Main Menu.
The best way to understand the functionality of this property is to read the following example:

Definitions:
My = vertical distance from top edge of Main Menu (in pixels)
Sy = vertical distance from top edge of the "Item 2" submenu (in pixels)
Final_Sy = vertical distance from frame's top edge of the submenu (in pixels)
Offset = the value you enter in the "Submenus Positioning Offset" field (positive or negative number of pixels)
In a two-framed web page, the submenu of "Item 2" opens correctly at Sy pixels from the top edge. The script automatically calculates the Sy distance based on the My value.
However, in a three-framed web page of the following setting, the submenu will open far away from its parent item due to the calculated Sy distance. The only way to avoid this is to manually enter the expected height of the top-right frame. In this particular setting, the Offset needs to be a negative number so that the final Sy distance is smaller.
The exact formula is: Final_Sy = Sy + Offset
STEP 2. Provided that the "Enable Cross-Frame Support" box is checked, the Compile Menu command creates two menu files instead of one:
the menuname.js file which contains the Main Menu only, and
the menuname_sub.js file which contains all the Submenus.
You need to link the menuname.js to the page where you want the Main Menu to appear, and the menuname_sub.js to the pages where you want the Submenus to appear.
Example:
Assuming that you use the following frameset:
<frame name="left" target="main" src="left_page.htm" scrolling="auto">
<frame name="main" src="main_page.htm" target="_self">
menuname.js should be linked to the left_page.htm,
menuname_sub.js should be linked to the main_page.htm and all other pages opening at the main frame.
Tip1: If you have only created frames so that your navigation is always visible, there is a better way to achieve this. You can avoid having frames by using a "Drifty" menu at the left or top of your page.
To view an on-line example on how to avoid frames using the "Drifty" feature, you may click on the link below:
http://www.likno.com/examples/example_frames_drifty.html
Tip2: For "horizontal" menus you may use "horizontal submenus" and still use frames, allowing a little space for the horizontal submenus to open.
Important Notes!
1. Using the cross-frame feature for menus placed on right frames:
Submenus always open at the left side of the target frame. While this is normal behavior for menus placed on left frames, it is not as good for menus placed on right frames (eg: Arabic or Hebrew framed web sites).
If you have a right-to-left, framed web site, and the Main Menu is placed on the right frame, then you need to enter the following code into the "Advanced Scripting" property:
var awmRightToLeftFrame=2;
Only if you use this variable will the submenus appear at the right side of the left frame (target frame for the submenus). Otherwise, the submenus will appear at the left side of the left frame (default behavior).
2. Do not use html files with a system default name like top.html, as it appears that it conflicts with conventional default target names top, new, parent, etc...