Submenu should stay opened

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
flyceo
Beginner
Beginner
Posts: 1
Joined: Thu May 25, 2006 5:27 pm

Submenu should stay opened

Post by flyceo »

Hello everybody!

I want to create a completely horizontal menu. I mean the main menu and all submenus are horizontal. If the mouse is over an item of the main menu of course the submenu opens. But if the mouse is out of the menu the opened submenu should stay opened. It should only be closed when the mouse is over another main menu item. Then the submenus should be replaced by the submenu of the newly selected item.

I tried to use "keepalive" but this did not work. With "keepalive" the submenus did not disappear - they entitled themselves wich caused problems.

So please help me and give me a good solution for my problem!

Thank you very much!
Roland

P.S.: Here is the code I used in menu_data.js as a test

Code: Select all

fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=0;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;




with(menuStyle=new mm_style()){
bordercolor='#999999';
borderstyle='solid';
borderwidth=1;
fontfamily='Verdana, Tahoma, Arial';
fontsize='75%';
fontstyle='normal';
headerbgcolor='#ffffff';
headercolor='#000000';
offbgcolor='#eeeeee';
offcolor='#000000';
onbgcolor='#ddffdd';
oncolor='#000099';
outfilter='randomdissolve(duration=0.3)';
overfilter='Fade(duration=0.2);Alpha(opacity=90)';
padding=4;
pagebgcolor='#82B6D7';
pagecolor='black';
separatorcolor='#999999';
separatorsize=1;
subimage='arrow.gif';
subimagepadding=2;
}

with(milonic=new menuname('Main Menu')){
alwaysvisible=1;
left=10;
orientation='horizontal';
style=menuStyle;
top=10;
aI('status=;text=Home;url=http://milonic.com/;');
aI('showmenu=Samples;text=Menu Samples;');
aI('showmenu=Milonic;text=Milonic;');
aI('showmenu=Partners;text=Partners;');
aI('showmenu=Links;text=Links;');
aI('showmenu=MyMilonic;text=My Milonic;');
}

with(milonic=new menuname('Samples')){
overflow='scroll';
style=menuStyle;
orientation='horizontal';
left=10;
keepalive=1;
aI('text=Plain Text Horizontal Style DHTML Menu Bar;url=http://milonic.com/menusample1.php;')
aI('text=Vertical Plain Text Menu;url=http://milonic.com/menusample2.php;')
aI('text=All Horizontal Menus;url=http://milonic.com/menusample25.php;')
aI('text=Using The Popup Menu Function Positioned by Images;url=http://milonic.com/menusample24.php;')
}

with(milonic=new menuname('Milonic')){
style=menuStyle;
orientation='horizontal';
left=10;
keepalive=1;
aI('text=Product Purchasing Page;url=http://milonic.com/cbuy.php;');
aI('text=Contact Us;url=http://milonic.com/contact.php;');
aI('text=Newsletter Subscription;url=http://milonic.com/newsletter.php;');
aI('text=FAQ;url=http://milonic.com/menufaq.php;');
aI('text=Discussion Forum;url=http://milonic.com/forum/;');
aI('text=Software License Agreement;url=http://milonic.com/license.php;');
aI('text=Privacy Policy;url=http://milonic.com/privacy.php;');
}

with(milonic=new menuname('Partners')){
style=menuStyle;
orientation='horizontal';
left=10;
keepalive=1;
aI('status=(aq) Web Server Hosting & Services;text=(aq) Web Hosting;url=http://www.a-q.co.uk/;');
aI('text=WebSmith;url=http://www.softidiom.com/?milonicmenu;');
aI('text=SMS 2 Email;url=http://www.sms2email.com/;');
}

with(milonic=new menuname('Links')){
style=menuStyle;
orientation='horizontal';
left=10;
keepalive=1;
aI('status=Apache Web Server, the basis of Milonics Web Site;text=Apache Web Server;url=http://www.apache.org/;');
aI('status=MySQL, Milonics Prefered Choice of Database Server;text=MySQL Database Server;url=http://ww.mysql.com/;');
aI('status=PHP - Web Server Scripting as used by Milonic;text=PHP - Development;url=http://www.php.net/;');
aI('status=PHP Based Web Forum, Milonics Recommended Forum Software;text=phpBB Web Forum System;url=http://www.phpbb.net/;');
aI('showmenu=Anti Spam;status=Anti Spam Solutions, as used by Milonic;text=Anti Spam Tools;');
}

with(milonic=new menuname('Anti Spam')){
style=menuStyle;
orientation='horizontal';
left=10;
keepalive=1;
aI('text=Spam Cop;url=http://www.spamcop.net/;');
aI('text=Mime Defang;url=http://www.mimedefang.org/;');
aI('text=Spam Assassin;url=http://www.spamassassin.org/;');
}

with(milonic=new menuname('MyMilonic')){
style=menuStyle;
orientation='horizontal';
left=10;
keepalive=1;
aI('text=Login;url=http://milonic.com/login.php;');
aI('text=Licenses;url=http://milonic.com/mylicenses.php;');
aI('text=Invoices;url=http://milonic.com/myinvoices.php;');
aI('text=Make Support Request;url=http://milonic.com/reqsupport.php;');
aI('text=View Support Requests;url=http://milonic.com/mysupport.php;');
aI('text=Your Details;url=http://milonic.com/mydetails.php;');
}

drawMenus();
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Try placing the keepalive=1; into the main menu item that opens the submenu.

Ruth
Post Reply