Sub menu padding help please!

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Td5boy
Beginner
Beginner
Posts: 4
Joined: Tue Jun 13, 2006 1:13 pm

Sub menu padding help please!

Post by Td5boy »

Hi everyone,

I've just acquired a Milonic menu and admit to being a code numbskull for the most part.

However I've got the menu working the way I need, and the padding for the main menu is great. Unfortunately the global padding value is carried over into the submenus and I'd like to specify a lower value if possible.

I'm sure there's a simple line or two that's needed, it's just that I can't work it out. (Code numbskull remember...)

Any help would be very gratefully received.

Here's the way it is online: http://www.bigyellospot.com The submenus are under "JOBS"

Here's my menu_data.js
fixMozillaZIndex=true; //Fixes Z-Index problem with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps

_menuCloseDelay=500; // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150; // The time delay before menus open on mouse over
_subOffsetTop=2;
_subOffsetLeft=-10;




with(menuStyle=new mm_style()){
bordercolor="#296488";
borderstyle="solid";
borderwidth=0;
fontfamily="Verdana, Helvetica, Tahoma, Arial";
fontsize="10px";
letterspacing="1px";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="none";
offcolor="#003838";
onbgcolor="#none";
oncolor="#666666";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=5)";
padding=15;
pagebgcolor="#CDEAF9";
pagecolor="black";
separatorcolor="#CDEAF9";
separatorsize=0;
// subimage="/images/arrow.gif";
// subimagepadding=2;
}

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=20;
overflow="scroll";
style=menuStyle;
top=125;
aI("status=Back To Home Page;text=HOME;url=http://www.bigyellospot.com/;");
aI("showmenu=WHO WE ARE;text=WHO WE ARE;url=http://www.bigyellospot.com/who.htm;");
aI("showmenu=WHAT WE DO;text=WHAT WE DO;url=http://www.bigyellospot.com/what.htm;");
aI("showmenu=RECENT WORK;text=RECENT WORK;url=http://www.bigyellospot.com/recent.htm;");
aI("showmenu=RESEARCH;text=RESEARCH;url=http://www.bigyellospot.com/research.htm");
aI("showmenu=JOBS;text=JOBS;");
aI("showmenu=NEWS;text=NEWS;url=http://www.bigyellospot.com/news.htm;");
aI("showmenu=CONTACT;text=CONTACT;url=http://www.bigyellospot.com/contact.htm;");
}

with(milonic=new menuname("WHO WE ARE")){
overflow="scroll";
style=menuStyle;

}

with(milonic=new menuname("WHAT WE DO")){
style=menuStyle;

}

with(milonic=new menuname("RECENT WORK")){
style=menuStyle;

}

with(milonic=new menuname("RESEARCH")){
style=menuStyle;

}

with(milonic=new menuname("JOBS")){
style=menuStyle;
aI("text=DESIGNERS;url=http://www.bigyellospot.com/designers.htm;");
aI("text=WRITERS;url=http://www.bigyellospot.com/writers.htm;");
aI("text=PROJECT MANAGERS;url=http://www.bigyellospot.com/managers.htm;");
}

with(milonic=new menuname("NEWS")){
style=menuStyle;

}


with(milonic=new menuname("CONTACT")){
style=menuStyle;

}

drawMenus();
[/quote][/url]
marty
Site Admin
Posts: 116
Joined: Tue May 21, 2002 6:48 pm
Location: Birmingham, UK

Post by marty »

Hi,

The easiest way is probably to create a second style, minus the unwanted padding:
with(newStyle=new mm_style()){
bordercolor="#296488";
borderstyle="solid";
borderwidth=0;
fontfamily="Verdana, Helvetica, Tahoma, Arial";
fontsize="10px";
letterspacing="1px";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="none";
offcolor="#003838";
onbgcolor="#none";
oncolor="#666666";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=5)";
pagebgcolor="#CDEAF9";
pagecolor="black";
separatorcolor="#CDEAF9";
separatorsize=0;
}
and then assign your style to the menu:
with(milonic=new menuname("JOBS")){
style=newStyle;
aI("text=DESIGNERS;url=http://www.bigyellospot.com/designers.htm;");
aI("text=WRITERS;url=http://www.bigyellospot.com/writers.htm;");
aI("text=PROJECT MANAGERS;url=http://www.bigyellospot.com/managers.htm;");
}
Hope this helps
-Marty
Td5boy
Beginner
Beginner
Posts: 4
Joined: Tue Jun 13, 2006 1:13 pm

Post by Td5boy »

Thanks Marty... that seems simple enough even for me.

I assume I just place the new style below the existing menuStyle? Make the changes to the submenus as you've indicated and Bob's your uncle as they say!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

That's correct. You can also shorten it if all you're changing is one or two items by using the copyOf method.

Code: Select all

newStyle=new copyOf(menuStyle); 
subStyle.padding=5; 
You might take a look at the Beginners' Guide link below my name, there are a few sections, 3 basic ones on style - it really is pretty basic so it won't give you advanced info, and it's a pretty quick read.

Ruth
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Marty... Marty who :?: :roll:
John
Post Reply