regexmatch problem

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
bgr
Beginner
Beginner
Posts: 1
Joined: Tue Oct 21, 2008 11:17 pm

regexmatch problem

Post by bgr »

I hope you can help me with this: We would like to set a special background color not only the current page's menu uten, but also to all its parent(s) menu item(s).

So, for example, in my Main Menu, I have a menu item called 'Barbara', which has a child menu called 'Barbara1', which has another child called 'Barbara2'. If the user is on the Barbara2 page, we want to see a different background color for all THREE menu items, i.e. Barbara, Barbara1 and Barbara2.

Here is my code:

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=0;
buildAfterLoad=true;
with(menuStyle=new mm_style()){
fontfamily='Lucida Sans Unicode','Lucida Grande','Lucida Sans','Tahoma',"Arial","Verdana";
fontsize="100%";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#fff";
menubgimage="http://localhost:8080/roostMortgage-theme/images/navigation/bg.png";
offbgcolor="transparent";
offcolor="#fff";
onbgcolor="black";
oncolor="#fff";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=5)";
padding=5;
pagebgcolor="#AF1E2D";
pagecolor="#fff";
}
with(menuDropStyle=new mm_style()){
fontfamily='Lucida Sans Unicode','Lucida Grande','Lucida Sans','Tahoma',"Arial","Verdana";
fontsize="100%";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#fff";
offbgcolor="#c5c6c2";
offcolor="#fff";
onbgcolor="black";
oncolor="#fff";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=100);Shadow(color=#777777', Direction=135, Strength=3)";
padding=5;
pagebgcolor="#AF1E2D";
pagecolor="#fff";
}
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
position="relative";
orientation="horizontal";
style=menuStyle;
menuwidth=800;
menuheight=25;
aI("showmenu=Barbara;text=Barbara;url=/web/guest/25;regexmatch=^(/web/guest/25)$;");
}
          
           
with(milonic=new menuname("Barbara")){
overflow="scroll";
style=menuDropStyle;
aI("showmenu=Barbara1;text=Barbara1;url=/web/guest/26;regexmatch=^(/web/guest/25|/web/guest/26)$;");
}	
	
with(milonic=new menuname("Barbara1")){
overflow="scroll";
style=menuDropStyle;
aI("text=Barbara2;url=/web/guest/27;regexmatch=^(/web/guest/25|/web/guest/26|/web/guest/27)$;");  
       			 
}
      
drawMenus();

So I have set the pagebgcolor in the style to get the background color I want. I also try to use the item's regexmatch property, but I guess I am not doing this correctly: This regular expression:

^(/web/guest/25|/web/guest/26|/web/guest/27)$

should match pages 25, 26 and 27 (aka Barbara, Barbara1 and Barbara2), but only page Barbara2 has the desired background color.

I'm using (a licensed) Version 5.803.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: regexmatch problem

Post by Ruth »

Hi,

That is automatic in the menu if you've set the pagebgcolor for the style used in the submenus.

For example, if you click on main item Barbara, then Barbara will highlight. If you click on the main item Barbara submenu item Barbara1 and go to that page, then Barbara and Barbara1 will highlight. If you click on the sub sub menu Barbara2, then Barbara, Barbara1 and Barbara2 will all highlight. If that is not happening I will have to see the page on the web to see what's going on.

Ruth
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Re: regexmatch problem

Post by Andy »

I think pagebgimage should be what is needed here.

Note that the regexmatch property is only for matching urls for a single menu item, not sure how it will work for more than one menu item as its never been tested.
Post Reply