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

Submenu should stay open if Mainmenu is active [Problem]


Poster: andy0815
Dated: Thursday December 14 2006 - 9:37:45 GMT

Hello,

we have a problem with a menu on:

http://bzwk.steindev.de/start.html

first:
the submenu schould stay open if the mainmenu-item is activated or a submenu-item is activated.

second:
if a submenu is activated and open and you "mouseover" an other, not activated mainmenu-item, the appertaining submenu-items should been displayed.

our menu is dynamically generated from a database, so some parts (for the active menu-items) are generated dynamically. the stuff in the curly brackets are variable.

Code:
aI("{CONF_STR}{IF_ACTIVE_EXISTS}");
}

and:

var yactive = getMenuByName('{NAME}');
menuDisplay(yactive, 1);


we tried this, but it doesn't works:

example:
Code:
with(milonic=new menuname("x")){
left=25;
top=120;
zindex=999;
alwaysvisible=1;
position="absolute";
orientation="horizontal";
style=stylex;

aI("showmenu=y0;text=Zeitwertkonto;url=../../web/zeitwertkonto/prinzip.html;offcolor=#000;offcolor=#000;");
aI("showmenu=y1;text=Unser Profil;url=../../web/profil/unternehmen.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( yactive, 1 );");
aI("showmenu=y2;text=Vorteile;url=../../web/vorteile/arbeitnehmer.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( yactive, 1 );");
aI("text=Karriere;url=../../web/karriere.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( yactive, 1 );");
aI("text=Anfragen;url=../../contact.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( yactive, 1 );");
aI("showmenu=y5;text=Service;url=../../web/service/downloads.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( yactive, 1 );");
}



with(milonic=new menuname("y0")){
orientation="horizontal";
style=styley;

aI("text=Das Prinzip;url=../../web/zeitwertkonto/prinzip.html;offcolor=#000;");
aI("text=Vorraussetzungen;url=../../web/zeitwertkonto/vorraussetzungen.html;");
aI("text=Die Chancen;url=../../web/zeitwertkonto/chancen.html;");
aI("text=Infos für Steuerberater;url=../../web/zeitwertkonto/infos-fuer-steuerberater.html;");
aI("text=Praxis-Tipps;url=../../web/zeitwertkonto/praxis-tipps.html;");
}

with(milonic=new menuname("y1")){
orientation="horizontal";
style=styley;

aI("text=Unternehmen;url=../../web/profil/unternehmen.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( yactive, 1 );");
aI("text=Leistungen;url=../../web/profil/leistungen.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( yactive, 1 );");
aI("text=ALCONTAS Gruppe;url=../../web/profil/alcontas-gruppe.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( yactive, 1 );");
}

.........



drawMenus();



var yactive = getMenuByName('y0');

menuDisplay(yactive, 1);




I hope you understand my english :roll:


Poster: Ruth
Dated: Thursday December 14 2006 - 10:40:01 GMT

Hi,

I'm posting this to someone for help because I don't know about functions, however, they will not be able to do any help until you upgrade to the newest menu version.

You have 5.753 and it is now 5.766. Make sure you keep your existing 3 program files....milonic_src, mmenudom, mmenuns4 some place in case problems occur with the newest version and you have to revert to the older one until any issue is fixed.

Ruth


Poster: andy0815
Dated: Thursday December 14 2006 - 11:07:23 GMT

ok we now have updated to version 5.766, but still the same problem :(

updated files to version 5.766:
mmenuns4.js
mmenudom.js
milonic_src.js

no ideas how to help us with the problem? :cry:


Poster: Ruth
Dated: Friday December 15 2006 - 23:15:02 GMT

Hi,

Well, I have no idea what that function is you have, it looks as if it's some function to try and keep the submenu active, that is visible. If that is all it is, then you might eliminate that and just use the keepalive=1; in each item.

The problem with that is it will not keep the main item yellow. And since it seems that each main item is also a link, you couldn't use something like openonclick with clickbgimage. If that is all that function does, you could set the top main menu to not have a link in the items that have a submenu, put the link into the actual submenu for the item, and then use openonclick=1;keepalive=1; and set clickbgimage in the style for the main menu to be that overbgimage.

Ruth


Poster: Andy
Dated: Tuesday December 19 2006 - 12:41:42 GMT

Hi,

Your function calls are not correct.

itemOn requires the item reference, not the menu reference

So change this:

Code:
aI("showmenu=y2;text=Vorteile;url=web/vorteile/arbeitnehmer.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( yactive, 1 );");


To this instead:


Code:
aI("showmenu=y2;text=Vorteile;url=web/vorteile/arbeitnehmer.html;onfunction=menuDisplay( yactive, 0 );offfunction=itemOn( _itemRef, 1 );");



The above will need doing for all menu items. THis should help suppress the error and hopefully solve the problem

Regards,
Andy