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:03
Sub menu padding help please!
Poster: Td5boy
Dated: Tuesday June 13 2006 - 13:22:43 BST
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
Quote:
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]
_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();
Poster: marty
Dated: Tuesday June 13 2006 - 13:35:34 BST
Hi,
The easiest way is probably to create a second style, minus the unwanted padding:
Quote:
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;
}
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:
Quote:
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;");
}
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
Poster: Td5boy
Dated: Tuesday June 13 2006 - 13:48:13 BST
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!
Poster: Ruth
Dated: Tuesday June 13 2006 - 18:21:18 BST
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:
newStyle=new copyOf(menuStyle);
subStyle.padding=5;
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