Menu/Item height & Centralizing Main Menu Items.

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
multiplexed
Beginner
Beginner
Posts: 8
Joined: Mon Oct 27, 2003 5:44 pm

Menu/Item height & Centralizing Main Menu Items.

Post by multiplexed »

How do I alter the height of the menu. I'm using the table cell compatible menu and when I insert the code into the proper cell it throws off the alignment of the page. I think the menu is just too tall and I can't resize the cell or that throws off the alignment as well.

Question 1 is how do shorten the main menu height. I've seen the menu quick reference but it doesn't tell you where to put the directive. I've tried putting itemheight=25 and menuheight=25 into both the main .html page and the menudata.js script but neither works. What's the default value?

Question 2 is the menu items are in the .html page. I know I can use SSI for central administration, but I'd rather put this stuff in a central javascript (unless SSI would reduce the weight of the page).

This is what I've copied and pasted into my main .html page in order to get this menu system to work. It'll probably wrap and is enclosed in a "<td>" tag.

Note that I only have a kindergarden level concept of .html and .js though I can configure directives if I know where and what to edit.

Code: Select all

<SCRIPT language=JavaScript src="scripts/milonic_src.js" type=text/javascript></SCRIPT>	
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=scripts/mmenuns4.js><\/scr"+"ipt>");		
else _d.write("<scr"+"ipt language=JavaScript src=scripts/mmenudom.js><\/scr"+"ipt>"); 
</script>
<SCRIPT language=JavaScript src="scripts/menu_data.js" type=text/javascript></SCRIPT>	
<script>
     with(milonic=new menuname("Main Menu")){
     style=menuStyle;
     top=155;
     left=200;
     alwaysvisible=1;
     orientation="horizontal";
     overfilter="";
     position="relative";
     aI("text=Home;url=http://milonic.com/;status=Back To Home Page;");
     aI("text=Menu Samples;showmenu=Samples;");
     aI("text=Milonic;showmenu=Milonic;");
     aI("text=Partners;showmenu=Partners;");
     aI("text=Links;showmenu=Links;");
     aI("text=My Milonic;showmenu=My Milonic;");
     }
     drawMenus();
</script>	
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi,

Looks like this one got missed... easy to do when the boards are busy. Anyway, I'll take a stab at it.
Question 1 is how do shorten the main menu height. I've seen the menu quick reference but it doesn't tell you where to put the directive. I've tried putting itemheight=25 and menuheight=25 into both the main .html page and the menudata.js script but neither works. What's the default value?
menuheight is not a supported property (hence, you don't see it mentioned in the quick reference pages), so that won't help you. Fortunately, if the menu is horizontal, as it seems you want yours to be, then the menu's height is essentially the same as each item's height. So, setting itemheight=25; should do the trick. You'll note in the docs that this is both a menu property (defined in the menu, outside of the aI() calls), as well as a menu item property (defined per item, in the aI() call). Functionally, however, they have the same effect in a horizontal menu. I.e., if you set one item of a horizontal menu to a specific height, then the rest of the items in the menu follow suit. So, you might as well just set it as a menu property (see code below). There is no default value, as far as I know. if not specified, the menu will size itself according to various entities, including fontsize, borders, padding, etc.
...but I'd rather put this stuff in a central javascript (unless SSI would reduce the weight of the page).
Shouldn't be a problem. Many people have done so, even if they are embedding the menu in a table. If you search the forum for "table" then you will run across many threads discussing the use of the menus in tables. I have to say, however, that I've seen lots of instances where people feel they must use tables for placing the menu when that really makes things over complicated. Many of those instances could be handles just as well by using the menu's internal placement capabilities, which are quite flexible.

Code: Select all

with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=155;
left=200;
alwaysvisible=1;
orientation="horizontal";
position="relative";
itemheight=25;
aI("text=Home;url=http://milonic.com/;status=Back To Home Page;");
aI("text=Menu Samples;showmenu=Samples;");
aI("text=Milonic;showmenu=Milonic;");
aI("text=Partners;showmenu=Partners;");
aI("text=Links;showmenu=Links;");
aI("text=My Milonic;showmenu=My Milonic;");
}
Hope that helps,

Kevin
Post Reply