Milonic Menu in Table with Offsets

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
shingy
Beginner
Beginner
Posts: 4
Joined: Wed Jul 19, 2006 12:29 am

Milonic Menu in Table with Offsets

Post by shingy »

HI, I hope this is a quick one. I am working on a menu which is inside a table cell, has padding set at 4 and I want to increase the left margin.

Any ideas would be greatly appreciated.

This is the menu data I am using...

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=2;
_subOffsetLeft=-2;

with(menuStyle=new mm_style()){
bgimage="http://www.shingy.com/active4/images/nav_bg.gif"
bordercolor="#CC0000";
borderstyle="";
borderwidth=0;
fontfamily="Verdana, Tahoma, Arial";
fontsize="11px";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#ffffff";
offbgcolor="#CC0000";
offcolor="#ffffff";
onbgcolor="#990000";
oncolor="#FFCC00";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90)";
padding=5;
pagebgcolor="#990000";
pagecolor="black";
separatorcolor="#";
separatorsize=0;
subimage="arrow.gif";
subimagepadding=2;
}

with(milonic=new menuname("Main Menu")){
style=menuStyle;
alwaysvisible=1;
position="relative";
menuwidth="180px";
orientation="vertical";
style=menuStyle;
aI("text=First Aid Online;url=http://www.shingy.com/;");
aI("showmenu=Publications;text=Publications;");
aI("showmenu=Ordering;text=Online Ordering;");
aI("showmenu=News;text=News;");
aI("showmenu=FAQ;text=FAQ;");
aI("showmenu=Downloads;text=Free Downloads;");
aI("showmenu=Links;text=Links;");
}

Here is an example of the Work In Progress page:

http://www.shingy.com/active4/int5.htm
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

You've got a couple of things kind of wrong in this.

You're embedded_main.js file should have only the main menu and a drawmenus at the end of it. All the rest goes into the menu_data.js file.

You seem to have all the menus in that embed file and also have a table data file which I have no idea what that is.

Your sub_data.js file [which is what I named it] would be the following. Please NOTE I put in a 'mainStyle' for the main menu. You will see it as mainStyle=new copyOf . This method allows you to use shorthand if all you are changing in a style is one or two items. It will use the menuStyle plus it will add whatever you have placed in the copyOf style, in this case the rawcss="margin:0 0 0 5"; which puts a left hand 5px margin in the main menu.

sub_data.js file:

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=2;
_subOffsetLeft=-2;

with(menuStyle=new mm_style()){
bgimage="nav_bg.gif"
bordercolor="#CC0000";
borderstyle="";
borderwidth=0;
fontfamily="Verdana, Tahoma, Arial";
fontsize="11px";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#ffffff";
offbgcolor="#CC0000";
offcolor="#ffffff";
onbgcolor="#990000";
oncolor="#FFCC00";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90)";
padding=5;
pagebgcolor="#990000";
pagecolor="black";
separatorcolor="#";
separatorsize=0;
subimage="arrow.gif";
subimagepadding=2;
}

mainStyle=new copyOf(menuStyle); 
mainStyle.rawcss="margin:0 0 0 5";


with(milonic=new menuname("Publications")){
style=menuStyle;
aI("text=Plain Text Horizontal Style DHTML Menu Bar;url=http://milonic.com/menusample1.php;")
aI("text=Vertical Plain Text Menu;url=http://milonic.com/menusample2.php;")
aI("text=All Horizontal Menus;url=http://milonic.com/menusample25.php;")
aI("text=Using The Popup Menu Function Positioned by Images;url=http://milonic.com/menusample24.php;")
aI("text=Classic XP Style Menu;url=http://milonic.com/menusample82.php;")
aI("text=XP Style;url=http://milonic.com/menusample86.php;")
aI("text=XP Taskbar Style Menu;url=http://milonic.com/menusample83.php;")
aI("text=Office XP Style Menu;url=http://milonic.com/menusample47.php;")
aI("text=Office 2003 Style Menu;url=http://milonic.com/menusample46.php;")
aI("text=Apple Mac Style Menu;url=http://milonic.com/menusample72.php;")
aI("text=Amazon Style Tab Menu;url=http://milonic.com/menusample74.php;")
aI("text=Milonic Home Menu;url=http://milonic.com/menusample78.php;")
aI("text=Windows 98 Style Menu;url=http://milonic.com/menusample13.php;")
aI("text=Multiple Styles Menu;url=http://milonic.com/menusample5.php;")
aI("text=Multi Colored Menu Items;url=http://milonic.com/menusample80.php;")
aI("text=Multi Colored Menus Using Styles;url=http://milonic.com/menusample7.php;")
}

with(milonic=new menuname("Ordering")){
style=menuStyle;
aI("text=Product Purchasing Page;url=http://milonic.com/cbuy.php;");
aI("text=Contact Us;url=http://milonic.com/contact.php;");
aI("text=Newsletter Subscription;url=http://milonic.com/newsletter.php;");
aI("text=FAQ;url=http://milonic.com/menufaq.php;");
aI("text=Discussion Forum;url=http://milonic.com/forum/;");
aI("text=Software License Agreement;url=http://milonic.com/license.php;");
aI("text=Privacy Policy;url=http://milonic.com/privacy.php;");
}

with(milonic=new menuname("News")){
style=menuStyle;
aI("text=(aq) Web Hosting;url=http://www.a-q.co.uk/;");
aI("text=WebSmith;url=http://www.softidiom.com/?milonicmenu;");
aI("text=SMS 2 Email;url=http://www.sms2email.com/;");
}

with(milonic=new menuname("FAQ")){
style=menuStyle;
aI("text=Apache Web Server;url=http://www.apache.org/;");
aI("text=MySQL Database Server;url=http://ww.mysql.com/;");
aI("text=PHP - Development;url=http://www.php.net/;");
aI("text=phpBB Web Forum System;url=http://www.phpbb.net/;");
aI("showmenu=Anti Spam;text=Anti Spam Tools;");
}

with(milonic=new menuname("Downloads")){
style=menuStyle;
aI("text=Spam Cop;url=http://www.spamcop.net/;");
aI("text=Mime Defang;url=http://www.mimedefang.org/;");
aI("text=Spam Assassin;url=http://www.spamassassin.org/;");
}

with(milonic=new menuname("Links")){
style=menuStyle;
aI("text=Login;url=http://milonic.com/login.php;");
aI("text=Licenses;url=http://milonic.com/mylicenses.php;");
aI("text=Invoices;url=http://milonic.com/myinvoices.php;");
aI("text=Make Support Request;url=http://milonic.com/reqsupport.php;");
aI("text=View Support Requests;url=http://milonic.com/mysupport.php;");
aI("text=Your Details;url=http://milonic.com/mydetails.php;");
}

drawMenus();
This is in your embed_main.js file

Code: Select all

with(milonic=new menuname("Main Menu")){
style=mainStyle;
alwaysvisible=1;
position="relative";
menuwidth="180px";
orientation="vertical";
aI("text=First Aid Online;url=http://www.shingy.com/;");
aI("showmenu=Publications;text=Publications;");
aI("showmenu=Ordering;text=Online Ordering;");
aI("showmenu=News;text=News;");
aI("showmenu=FAQ;text=FAQ;");
aI("showmenu=Downloads;text=Free Downloads;");
aI("showmenu=Links;text=Links;");
}

drawMenus();
The sub_data.js file gets called up with the other menu files right after the body tag, and the main file gets called as you have it now in the table.

Hope that helps.

Ruth
shingy
Beginner
Beginner
Posts: 4
Joined: Wed Jul 19, 2006 12:29 am

Thank you, Thank You, Thank You...

Post by shingy »

YEs I amnew to this, but all of what you said makes sense and works. Ruth, you are a rockstar.

Cheers :D
Post Reply