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:39
How do I force a menu to open when the page loads?
Poster: phodges4
Dated: Wednesday March 7 2007 - 6:23:49 GMT
I've searched these forums and haven't been able to figure out the solution to this. I have a menu that has 2 submenus. I want it so when a submenu page is loaded the submenu will automatically open up. I need a function called GetCurrentHighlightedMenuItem() lol .. so I can just open that items parent menu! Any IDEAS!?!? tyia!
-p4
Poster: Ruth
Dated: Wednesday March 7 2007 - 7:22:40 GMT
Hi,
Actually, there is a module to go with the menu called openmenusbyurl.js This module forces a submenu to open when the url matches.
http://www.milonic.com/menumodules.php
It's down in the middle someplace Automatic Menu Opening Module.
If you can't get it to work correctly you'll need to post your site with the menu so we can check it.
Ruth
oops!
Poster: phodges4
Dated: Friday March 9 2007 - 15:30:30 GMT
Ruth wrote:
Hi,
Actually, there is a module to go with the menu called openmenusbyurl.js This module forces a submenu to open when the url matches.
http://www.milonic.com/menumodules.php
It's down in the middle someplace Automatic Menu Opening Module.
If you can't get it to work correctly you'll need to post your site with the menu so we can check it.
Ruth
Actually, there is a module to go with the menu called openmenusbyurl.js This module forces a submenu to open when the url matches.
http://www.milonic.com/menumodules.php
It's down in the middle someplace Automatic Menu Opening Module.
If you can't get it to work correctly you'll need to post your site with the menu so we can check it.
Ruth
I lied, it partially worked. The submenus do in fact open; however, once the submenu is open, any of the main menu buttons ceise to work. I only have this active on one page of the site, but here is the link. http://www.rabautsinteriors.com/windows.php
Any help would be greatly appreciated. Thanks!
Poster: Ruth
Dated: Friday March 9 2007 - 17:21:26 GMT
Hi,
Well, I don't know much about scripts and I'm not sure why you have put the openmenusbyurl script into the menu_data2.js file.
Remove that, and the stuff at the end after the drawMenus and it seems to work, OK.
Just out of curiosity, can you tell me why you've put all the coding into the various menus? They seem to have all the same coding, why not just put them into a style, like this?
Code:
fixMozillaZIndex=true; //Fixes Z-Index problem with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=0;
_subOffsetLeft=5;
with(menuStyle=new mm_style()){
bordercolor="#FFFFFF";
borderstyle="solid";
borderwidth=0;
fontfamily="Arial, Helvetica, sans-serif";
fontsize="12px";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="#ffffff";
offcolor="#666666";
onbgcolor="#ffffff";
oncolor="#990000";
//outfilter="randomdissolve(duration=0.3)";
//overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=5)";
padding=5;
pagebgcolor="#ffffff";
pagecolor="#810031";
//separatorcolor="#ffffff";
//separatorsize=0;
subimage="arrow.gif";
subimagepadding=1;
}
subStyle=new copyOf(menuStyle);
subStyle.offbgcolor="#CCCCCC";
subStyle.onbgcolor="#CCCCCC";
subStyle.offcolor="#666666";
subStyle.onbgcolor="#810031";
subStyle.pagebgcolor="#CCCCCC;";
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=00;
style=menuStyle;
top=10;
aI("text=;url=index.php;image=rabautslogo130.gif;");
aI("text=Home;url=index.php;");
aI("text=About Rabaut's;url=about.php;");
aI("text=Space Planning;url=spaceplanning.php;");
aI("showmenu=Services;text=In House Services;keepalive=1;");
aI("showmenu=Portfolio;text=Portfolio of Interiors;keepalive=1;");
aI("text=The Store;url=thestore.php;");
aI("text=Contact;url=contact.php;");
}
with(milonic=new menuname("Services")){
overflow="scroll";
style=subStyle;
keepalive=1;
aI("text=Window Treatments;url=windows.php;");
aI("text=Reupholstery;url=reupholstery.php;");
aI("text=Fabric Selection;url=fabrics.php;");
}
with(milonic=new menuname("Portfolio")){
overflow="scroll";
style=subStyle;
aI("text=Kitchens;url=kitchens.php;");
aI("text=Dining Rooms;url=diningrooms.php;");
aI("text=Bathrooms;url=bathrooms.php;");
aI("text=Bedrooms;url=bedrooms.php;");
aI("text=Living Rooms;url=livingrooms.php;");
aI("text=Family Rooms;url=familyrooms.php;");
aI("text=Window Treatments;url=windowtreatp.php;");
aI("text=Built Ins;url=builtins.php;");
}
drawMenus();
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=0;
_subOffsetLeft=5;
with(menuStyle=new mm_style()){
bordercolor="#FFFFFF";
borderstyle="solid";
borderwidth=0;
fontfamily="Arial, Helvetica, sans-serif";
fontsize="12px";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="#ffffff";
offcolor="#666666";
onbgcolor="#ffffff";
oncolor="#990000";
//outfilter="randomdissolve(duration=0.3)";
//overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=5)";
padding=5;
pagebgcolor="#ffffff";
pagecolor="#810031";
//separatorcolor="#ffffff";
//separatorsize=0;
subimage="arrow.gif";
subimagepadding=1;
}
subStyle=new copyOf(menuStyle);
subStyle.offbgcolor="#CCCCCC";
subStyle.onbgcolor="#CCCCCC";
subStyle.offcolor="#666666";
subStyle.onbgcolor="#810031";
subStyle.pagebgcolor="#CCCCCC;";
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=00;
style=menuStyle;
top=10;
aI("text=;url=index.php;image=rabautslogo130.gif;");
aI("text=Home;url=index.php;");
aI("text=About Rabaut's;url=about.php;");
aI("text=Space Planning;url=spaceplanning.php;");
aI("showmenu=Services;text=In House Services;keepalive=1;");
aI("showmenu=Portfolio;text=Portfolio of Interiors;keepalive=1;");
aI("text=The Store;url=thestore.php;");
aI("text=Contact;url=contact.php;");
}
with(milonic=new menuname("Services")){
overflow="scroll";
style=subStyle;
keepalive=1;
aI("text=Window Treatments;url=windows.php;");
aI("text=Reupholstery;url=reupholstery.php;");
aI("text=Fabric Selection;url=fabrics.php;");
}
with(milonic=new menuname("Portfolio")){
overflow="scroll";
style=subStyle;
aI("text=Kitchens;url=kitchens.php;");
aI("text=Dining Rooms;url=diningrooms.php;");
aI("text=Bathrooms;url=bathrooms.php;");
aI("text=Bedrooms;url=bedrooms.php;");
aI("text=Living Rooms;url=livingrooms.php;");
aI("text=Family Rooms;url=familyrooms.php;");
aI("text=Window Treatments;url=windowtreatp.php;");
aI("text=Built Ins;url=builtins.php;");
}
drawMenus();
Ruth
Poster: phodges4
Dated: Friday March 9 2007 - 17:50:49 GMT
I, in fact, did not write the menu_data2.js file so I have no idea why a style wasn't used. I changed the submenus to use a style and removed that code you mentioned. However, that code was actually commented out already so it had no bearing on the script. If you go to the windows.php page, the main menu items still do not work for me .. I have tried it in both Firefox 2.0 and IE7 ..
http://www.rabautsinteriors.com/windows.php
Poster: Ruth
Dated: Friday March 9 2007 - 20:08:20 GMT
Hi,
I am going to have to report this to Milonic. The links will work, until you open the windows.php page and have the menu opened automatically. Then the only links that work seem to be the ones in the submenus.
Hopefully, Milonic will be able to figure it out.
Ruth
Poster: beyoyo2
Dated: Thursday March 15 2007 - 15:11:46 GMT
Ruth wrote:
Hi,
I am going to have to report this to Milonic. The links will work, until you open the windows.php page and have the menu opened automatically. Then the only links that work seem to be the ones in the submenus.
Hopefully, Milonic will be able to figure it out.
Ruth
I am going to have to report this to Milonic. The links will work, until you open the windows.php page and have the menu opened automatically. Then the only links that work seem to be the ones in the submenus.
Hopefully, Milonic will be able to figure it out.
Ruth
Anyword from our friends at Milonic regarding this problem?
Bill