Hi,
I am using lecenced version of Milonic menu.
In mycase I get the links in a submenu dynamically.
I am using teh divhider.js .
I have make the div hide based on the number of links.
Ex:
If a sub menu has 12 links I need not hide the div.
If it has 13 links I have to.Because under teh 13 link there is the select box.
Is there any way I can know the number of links in a sub menu?
Plz help me.
Thanks,
Ravi.
know the number of links in a sub menu
-
- Advanced
- Posts: 10
- Joined: Tue Feb 21, 2006 3:35 pm
Hi,
Try something like this:
Assuming you want to know the number of items inside "Main Menu" - Just change the menu name in order to get the number of items from another menu
Try something like this:
Code: Select all
<script>
menuname="Main Menu";
menunumber=getMenuByName(menuname);
alert(_m[menunumber][0].length)
</script>
-
- Advanced
- Posts: 10
- Joined: Tue Feb 21, 2006 3:35 pm
How to know parent menu?
Thank you Andy. 
My problem is solved.
I have another issue. Please help me in this also.
I have a sub menu link, same in two menus.
But for the same link I have to invoke different actions based on the menu it is being called from.How to know the parent menu?
Ex:
I have two menus A and B.
C is the sub menu link that exists in both A and B.
If C of A is clicked I should call D and if C of B is clicked I should call E.
For that I want to know the parent menu of the link being clicked.
Please help me.
Thanks,
Ravi.

My problem is solved.
I have another issue. Please help me in this also.
I have a sub menu link, same in two menus.
But for the same link I have to invoke different actions based on the menu it is being called from.How to know the parent menu?
Ex:
I have two menus A and B.
C is the sub menu link that exists in both A and B.
If C of A is clicked I should call D and if C of B is clicked I should call E.
For that I want to know the parent menu of the link being clicked.
Please help me.
Thanks,
Ravi.
It's as easy as pie:
getParentMenuByItem(itemReference)
Try this:
Should return the number of the parent menu, if you want the parent menu name, the try this:
Hope this helps,
Andy
getParentMenuByItem(itemReference)
Try this:
Code: Select all
alert(getParentMenuByItem(_itemRef));
Code: Select all
alert(_m[getParentMenuByItem(_itemRef)][1]);
Andy
-
- Advanced
- Posts: 10
- Joined: Tue Feb 21, 2006 3:35 pm