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:44

Current Page Indicator doesn't work with multiple menus?


Poster: SabbeRubbish
Dated: Monday January 8 2007 - 22:29:13 GMT

http://users.skynet.be/sabberubbish/akademos/biografie.htm
I've read many posts already and I know how much you like to see things :wink:

So my problem: I love those current page indicators, really great! But I want them to show up on both menus on the page. Problem is, that the menus are from different source files, but well, they do show the same content, and that is the desired behaviour, I want one horizontal and one vertical bar.

What am I doing wrong?
Or is it supposed to not show the current page indicator twice?
I've also found that it's only the first loaded .js file with menu declarations that gets the Current Page Indicator.
Oh and to make it even worse, the submenu indicators work just fine ;)

Many thanks in advance!
SabbeRubbish

My files (partially):
menu_data.js (the top one)
Code:
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=380;
orientation="horizontal";
style=menuStyle;
top=82;
aI("text=Home;url=.;");
aI("showmenu=akademos;text=Over Akademos;");
aI("showmenu=muziek;text=Muziek;");
aI("showmenu=praktisch;text=Praktisch;");
aI("showmenu=communicatie;text=Communicatie;");
}

menu_data2.js (the right one)
Code:
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=12;
orientation="vertical";
style=menuStyle;
top=30;
aI("text=Home;url=.;");
aI("showmenu=akademos;text=Over Akademos;");
aI("showmenu=muziek;text=Muziek;");
aI("showmenu=praktisch;text=Praktisch;");
aI("showmenu=communicatie;text=Communicatie;");
}


Some pages might not work, as they're not uploaded yet. The best test is to use the "Biografie" link, sorry for the Dutch.


Poster: Andy
Dated: Monday January 8 2007 - 23:55:08 GMT

Hi,

Quote:
I've read many posts already and I know how much you like to see things :wink:


yeah, you'll see lots of "my menu doesn't work" posts - Could literally be a Million reasons why and we are not mind readers so a link is ESSENTIAL;)


Anyway, to your problem - It does work but you're menu names need to be unique.

In other words, you've got 2 main menus that both have items pointing to the same sub menu. Namely "akademos" - This menu is declared twice, once in menu_data.js and again in menu_data2.js. If you give your menus unique names then you'll see the pagematching appear correctly.

However, you'll then see the menus appear in the wrong place because you are embedding the main menus and sub menus inside a relative object, a DIV.

All you need to do is build the sub menus on their own, preferably inside the <HEAD> or just after <BODY> (but not inside any other HTML Object) than.....Only build the main menus inside the HTML objects, this should solve all problems.

Please see http://www.milonic.com/tablemenu.php for more information on embedding menus inside relative objects.


Poster: SabbeRubbish
Dated: Tuesday January 9 2007 - 9:32:53 GMT

Thank you so very much Andy.
I've named the submenu's differently, from akademos to akademos2, consistent with the menu_data2.js, and now current page indication works just fine! Thanks.
Then my menu got overlapping with the content area, and indeed the "Embedding into a table" page helped me out a lot, putting the declaration in the beginning of the file, and positioning it absolute (which is not that clean, but in the top area, everything is absolute anyway).

Many thanks for this wonderful piece of equipment and the great support, I'll tell on ;)