How do I force a menu to open when the page loads?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
phodges4
Beginner
Beginner
Posts: 4
Joined: Wed Mar 07, 2007 7:08 am

How do I force a menu to open when the page loads?

Post by phodges4 »

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

Post by Ruth »

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://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
phodges4
Beginner
Beginner
Posts: 4
Joined: Wed Mar 07, 2007 7:08 am

Thanks!

Post by phodges4 »

It worked thanks a ton!
-p4 :D
phodges4
Beginner
Beginner
Posts: 4
Joined: Wed Mar 07, 2007 7:08 am

oops!

Post by phodges4 »

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

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();
Ruth
phodges4
Beginner
Beginner
Posts: 4
Joined: Wed Mar 07, 2007 7:08 am

Post by phodges4 »

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

Post by Ruth »

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
beyoyo2
Beginner
Beginner
Posts: 1
Joined: Thu Mar 15, 2007 4:06 pm

Post by beyoyo2 »

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
Anyword from our friends at Milonic regarding this problem?
Bill
DMDurant
Beginner
Beginner
Posts: 4
Joined: Wed Mar 21, 2007 4:02 pm

Post by DMDurant »

I am experiencin the same issue.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

The problem has been fixed now with the newest menu version 5.771.

Ruth
Post Reply