Now I am doing this help some of those people out there that want to use the version 5 menu with frames. I would just like to first say that Milonic nor I,
will not support this method. I am giving it out
as is and if you are not savvy enough with Javascript to understand it and figure it out, then do not use it and don't ask Milonic about it. Also this is tested in IE only, if you want it in Netscape, you may have to edit it yourself.
I will refer to the "parent frame" from now on as the frame with the main menu which opens sub menus in the "child frame". This little tweak will allow you to have a main menu in the parent frame which opens menus in another child frame. However, when you mouseout of the main menu, any submenus open in the child frame will remain open until you hover into and out of one. Hovering over different menu items in the parent frame will open and close menus in the child frame as expected. Also, when you enter a sub menu, the parent menu item will not remain highlighted since they are in separate menus on separate pages and they technically have no knowledge of eachother, this tweak is only meant as a "bridge" between the two frames and is just that, a tweak, so you can't have everything work perfectly, eh?
What each page/frame should have:
You must include as usual the milonic_src, mmenudom, and mmenuns4 files into ALL frames the same way you do now. Each page uses them separately. Instead of the normal menu_data file in the parent frame with the main menu, you should include a menu_data_main.js file which looks just like your usual menu_data file except it only has one style and one menu definition with alwaysvisible set to 1. Keep drawmenus() at the bottom of the file. In the child frame, you should have a menu_data_subs.js file included that contains styles and menu definitions for any menus you want to show up in that frame based on mouseovers in the parent frame. Also leave the drawMenus() call just like in the other js file.
What each menu_data_xxxx.js file should contain:
**** menu_data_main.js ****
As stated, should look like the usual menu_data, just one style and one menu definition. Copy this function into the top of your menu_data_main.js file.
Code: Select all
//distantMenu - opens up milonic menuName inside of frameName
function distantMenu( menuName, frameName )
{
parent.frames[frameName].popdown();
parent.frames[frameName].popup(menuName);
}
Now your aI()'s for menus should look like this.
Code: Select all
aI("text=Home;url=#;status=;onfunction=distantMenu('home','mainFrame');");
aI("text=Products;url=#;status=;onfunction=distantMenu('products','mainFrame');");
Notice how there is NO showmenu call, this is on purpose, we are relying on the onfunction method to call on the menu, not showmenu. Remember, leave in drawMenus();.
**** menu_data_subs.js ****
This file should also look like the usual menu_data file. But each menu definition should have a TOP and LEFT defined and alwaysvisible set to 0. You must specify top and left to determine where the menu will appear when its caller is moused over in the parent frame. Align it how you want to get the effect you want. For each menu name you specified in the parent frame, you have to have a menu with that name in this file in this frame so it knows what to open. So for my example above, I would have something like...
Code: Select all
...style stuff....
with(milonic=new menuname("home")){
top="30";
left="0";
orientation="vertical";
itemwidth=170;
borderwidth=1;
margin=3;
style=SubStyle;
aI("text=GO back home;url=/default.htm;status=Go Home;");
aI("text=Other;url=other.htm;status=Go Other;");
}
with(milonic=new menuname("products")){
top="50";
left="0";
orientation="vertical";
itemwidth=170;
borderwidth=1;
margin=3;
style=SubStyle;
aI("text=Product 1;url=/prods/item1.htm;");
aI("text=Product 2;url=/prods/item2.htm;");
}
drawMenus();
These values would make the menus butt up against the left side of the frame since left is "0". My top position helped to make the menu line up within the area of where the main menu item is in my parent frame.
Like I said, this is
not supported my Milonic nor myself, I just threw it up so anyone who REALLY wanted to see if they could get it done can do it and still have the benefits and features of the new version. If something is wrong with my code or directions, I will fix it, but if you can't get it to work, I can't use my time to support it when we have the real stuff to worry about.
Enjoy it and use it at your own risk.
