Hi everyone,
Small problem here that I hope someone has an answer to.
I have a basic horizontal menu that is our basic navigation on our site.
I am working on adding a context menu, but one created dynamically with javascript using the mm_menueditapi.
The main menu created with drawMenus() works, and I have seen articles on how to do multiple menus with multiple calls to drawMenus(). That's not the problem, however.
The dynamically created mm_menueditapi works by itself, and it does pop up correctly when on the same page as the drawMenus() menu.
However, when I start to mouseover the dynamic context menu created with mm_menueditapi, then something strange happens. It appears that the menu thinks I'm also mousing over the main menu at the top that was created with drawMenus().
The main menu is named something like "mainmenu" and the other menu has a name like "Assignment Menu". The names should be different, so this should work?
Is there a way to specify that the menu created with mm_menueditapi is a 2nd "main menu" rather than linked to the first? Or does anyone know why mousing over one menu would affect another one if they are named differently?
Thanks for any help or suggestions.
brian.
drawMenus() mm_menueditapi dynamically created menu - SOLVED
Thought I might add some code to this.
Basically, I'm using a slightly modified mm_addMenu function to allow me to set the name of the created menu, instead of getting the automated menu5 or whatever. I also commented out the popup so that the menu would stay hidden until i popped it up myself.
Basically, I'm using a slightly modified mm_addMenu function to allow me to set the name of the created menu, instead of getting the automated menu5 or whatever. I also commented out the popup so that the menu would stay hidden until i popped it up myself.
Code: Select all
function mm_addContextMenu()
{
var a=arguments
var n=_m.length;
with(milonic=new menuname(a[3])){
style=a[0];
alwaysvisible=false;
if(a[1])eval(a[1])
_itemProps=""
if(a[2])_itemProps=a[2]
_bl=_mi.length
aI("text=New Item;"+_itemProps);
}
mm_createNewMenus();
//popup("newmenu"+n,1)
return n;
}