Hi Kat,
To use two menu array files: The file containing the line
Code: Select all
menunum=0;menus=new Array();_d=document;...
should be the first one sourced into the .html file. Other menu array files should follow (with the "menunum=0..." line of code at the top commented out or deleted, as you've done). mmenu.js should be the
last of the menu scripts sourced into the .html file. In your case, the order is currently: menu_array.js, mmenu.js, menu_array2.js; so the menus in menu_array2.js will be ignored. You should make the order: menu_array.js, menu_array2.js, mmenu.js.
I noticed another problem in menu_array2.js that will also prevent the menus in that file from being displayed. The 6th element in your "sidemenu" array (the Screen Position property) is currently set to
left. This is a string, so it should be
"left" (in double quotes). Without the quotes, you may have noticed a "left is not defined" error (or some such, depending on the browser) when you opened the .html file.
A couple of other comments:
(1) Unless the sidemenu will only appear on some pages (not all pages), you can place all of your menu arrays in one file. I.e., your "sidemenu" array and all of its submenu arrays can go into menu_array.js. Having the Always Visible property set to 1 for the "sidemenu" will make it a "main" menu. Then you don't have to worry about loading order and removing that line of code at the top. Also, since there are fewer file requests to the server, loading time should be somewhat improved. I find this approach convenient for "main" menus that will appear on every page. Others find that it makes more sense to organize different "main" menus into separate .js files.
(2) If you want to stick with the multi-file approach, if your style arrays are the same in both files, you should be able to remove them from menu_array2.js... they're global in scope, so the style arrays defined in menu_array.js should still be available to the menu arrays defined in menu_array2.js (less overall code = faster loading). I haven't tested this in
all browsers, but I find that it works for me when I want to use multiple .js files with common style arrays.
(3) A humble suggestion. I noticed that your page design leaves a nice left margin all the way down and that some pages on your main site are long. So, for your side menu, rather than bind it to a table, where it'll scroll off the top of a long page, have you considered using the menu's Follow Scrolling property, so it'll move down the page as you visitor scrolls? You could easily put the Mammals and Reptiles headers inside the menu, so they'll scroll with it. Not only would the menu remain available to the user as he or she scrolls down, but it would also increase the "coolness" factor! You could have a convenient "Back to the Top" link in the side menu to quickly take the visitor back to your top menu -- or -- you could even replicate the main menu selections off of one "main" item in your side menu (defined submenus can be opened fom multiple menu items). Just some thoughts.
Hope that helps,
Kevin