Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:01

Menu Visibility Functions


Poster: nbarth
Dated: Thursday October 23 2003 - 23:08:13 BST

I was using version 3 and some one helped me to write these functions to show and hide menus. Could someone help me to write the 5.0 equivelant?

Code:

// Menu Visibility Functions ---------------- 

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);
}

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);
}


Poster: kevin3442
Dated: Thursday October 23 2003 - 23:40:49 BST

Hmmm... me thinks those look familiar....

How 'bout these:

Code:
function mm_showMenu(menuName) // , alwaysVisState = optional. 1=on, 0=off
{
  if (arguments.length > 1) _m[getMenuByName(menuName)][8] = arguments[1];
  popup(menuName);
}

function mm_hideMenu(menuName) // , alwaysVisState = optional. 1=on, 0=off
{
  var menuNum = getMenuByName(menuName);
  if (arguments.length > 1) {
    _m[menuNum][8] = arguments[1];
  }
  menuDisplay(menuNum, 0);
}


Word of caution: the mm_showMenu() function will not work unless the named menu already has a position in which to open! In other words, that menu must (a) have a location -- e.g., top/bottom, screenposition -- already set in the menu definition, or (b) have already been opened from a different source, like a "higher-level" menu, or (c) have the positions programatically set through some other function (which is possible) prior to calling the mm_showMenu() function.

Hope that helps (and works!),

Kevin

They work!


Poster: nbarth
Dated: Friday October 24 2003 - 5:13:39 BST

Thanks so much Kevin!

Nicholas


Poster: Maz
Dated: Friday October 24 2003 - 5:35:50 BST

I decided on a much simpler solution, I just placed my complete menu in one main menu item, it could be any kind of link you want, then open the main menu up from there :)

maz

I appreciate the suggestion


Poster: nbarth
Dated: Friday October 24 2003 - 6:40:56 BST

maz,

I may have to try that.

Thanks,
Nicholas