Submenu should stay open if Mainmenu is active [Problem]

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
andy0815
Beginner
Beginner
Posts: 2
Joined: Thu Dec 14, 2006 9:52 am

Submenu should stay open if Mainmenu is active [Problem]

Post by andy0815 »

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: Select all

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

and:

var yactive = getMenuByName('{NAME}');
menuDisplay(yactive, 1);
we tried this, but it doesn't works:

example:

Code: Select all

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:
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
andy0815
Beginner
Beginner
Posts: 2
Joined: Thu Dec 14, 2006 9:52 am

Post by andy0815 »

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:
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

Your function calls are not correct.

itemOn requires the item reference, not the menu reference

So change this:

Code: Select all

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

Code: Select all

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
Post Reply