Hi Nicholas,
Here are a couple of functions that might help:
Code: Select all
function mm_showMenu(menuName) // + , alwaysVis)
{
var menuNum = getMenuByName(menuName);
if (arguments.length > 1) {
var menuArr = eval("menu" + menuNum);
menuArr[7] = arguments[1];
}
SDiv("menu" + menuNum, 1);
}
mm_showMenu() takes the name of the menu you want to open as it's first parameter (menuName), and the Always Visible state as an optional second parameter (alwaysVis). For example, suppose you want to open a menu named "sidemenu". You would call:
The 1 in the second parameter sets the menu's Always Visible property, so the menu will not close until you do so programatically, using the mm_hideMenu() function, shown below.
Code: Select all
function mm_hideMenu(menuName) // + , alwaysVis)
{
var menuNum = getMenuByName(menuName);
if (arguments.length > 1) {
var menuArr = eval("menu" + menuNum);
menuArr[7] = arguments[1];
}
SDiv("menu" + menuNum, 0);
}
mm_hideMenu() does what it suggests: hides the named menu. If you wanted to close "sidemenu" you would call
Note that the 0 to clear the Always Visible property is not really necessary (you can actually programatically hide a menu even if it's Always Visible property is set), but it makes logical sense, especially if you want to open the same menu for some other reason, then have it disappear automatically when the user mouses out of it.
Hope that helps,
Kevin