Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:32

how to fit Menu in a table cell ,how to control Menu widht?


Poster: ronwolpa
Dated: Thursday April 24 2003 - 4:36:14 BST

april 23 2003

I have attempted to adapt menu bar to this lay out

:arrow: (http://sites.uol.com.br/multi-media-mkt/index.html)

and have faced the following trouble :

- menu bar spans from left to the right corner of the browser screen (see given URL );

- that makes menu incompatible with my lay out as Menu area overflows
the main table on my lay out ;


- I cannot limit menu width by placing it into a table cell for instance
(I`ve tried to place the script into the cell of a table but it does not work)

- a tentative solution was to left blank the "Mouse Off Background Color" line of the script but then the drop down items of menu cannot be read easily because 3D effect as well as the transparent background ;
....................................................................................................................................
style2=[ // style1 is an array of properties. You can have ........
"003366", // Mouse Off Font Color
"6495ED", // Mouse Off Background Color >>>THIS LINE WAS LEFT BLANK
.....................................................................................................................................

Is there a simple way to control the Width of the menu :?:
Hope I´ve been clear enough ;

Cheers

Ron Wolpa
ron_wolpa __at__ hotmail.com

create a centralised menu


Poster: snapey
Dated: Thursday April 24 2003 - 22:12:37 BST

Ron

I think you will struggle because your table has a fixed width, and is automatically centred. This means that you cannot predict the left edge of the menu.

You can though center the menu on the screen.

If you setup the menu with 5 horizontal items, and set the menu width to be 140 (5 x 140 = 700) then set the table to be 700 wide, you will have a menu that appears to be part of your centre panel.

within each menu 'cell' you can have the text left, right or centred, but I found that left justified menu items are too near the divider, so just add a space or a   to the start of each menu text.

Hope this helps a bit.

(ps - why do you have the code in your page and called with a script statement?)


Poster: ronwolpa
Dated: Friday April 25 2003 - 5:37:47 BST

Hi Snapey

1- Picking my brains on your suggestions , don´t understand how I will have each one of the 5 menus into a table cell ;

I am still learning on how to deal with Menu that does not seem to be very lithe nor friendly ;

2-Regarding your :

(ps - why do you have the code in your page and called with a script statement?)

What exactly do you mean ? I tried to take the script out of html, left only lines below :

<SCRIPT language=javascript src="navbar_js/mmenu_array.js">
</SCRIPT>

<SCRIPT language=javascript src="navbar_js/mmenu.js">
</SCRIPT>

...and menu doesn´t work.
I find it odd to have the code on html and almost the same stuff on mmenu_array.js.

Sorry If I say something stupid , I haven´t quite understood how the whole thing works together.

Thank you very much for your attention.

Cheers

Ron Wolpa


Poster: snapey
Dated: Friday April 25 2003 - 8:58:03 BST

First let's try and get you loading the menu ok.
You don't need anything in the document apart from the two lines where you call the javascript. All you need to do is to ensure that the path is correct in relation to where you have stored the page, and then you need to remove your comment marks in the mmenu_array.js file on the middle line of these three:

Code:
// The following line is critical for menu operation, and must appear only once.
//menunum=0;menus=new Array();_d=document;function addmenu(){menunum++;.......
//Please leave the above line intact. The above also needs to be enabled if it not already enabled

For your menu, sorry if I have caused confusion talking about tables and cells. The menu has nothing to to with tables and is not controlled by them. You can imagine the menu floating on a layer above the text of the page, and not constrained by anything that goes on underneath.

so, try the following parameters for your menu:

Code:
addmenu(menu=[      // This is the array that contains your menu properties and details
"mainmenu",         // Menu Name - This is needed in order for the menu to be called
190,            // Menu Top - The Top position of the menu in pixels
,               // Menu Left - The Left position of the menu in pixels
140,               // Menu Width - Menus width in pixels
,               // Menu Border Width
"center",            // Screen Position - here you can use "center;left;right;middle;top;bottom" or a combinatio...


Note that Menu Left is empty, Menu Width is 140 and position is centre.

If you now have 5 entries in your menu then the total width of the menu will be 5 x 140 = 700, positioned horizontally centred, 190 pixels down the screen.

You can have more or less entries in your top level, you just need to adjust the menu width (remember this is the fixed width of each menu item, not the whole menu) so that the width x the number of entries is the same as your underlying table.
Regards
Mark


Poster: ronwolpa
Dated: Saturday April 26 2003 - 7:03:03 BST

Thank you very much for your answer Mark !
However I made up my mind to use another solution which is on a tut in this site , Bound to cell ; there is a disadvantage to show the menu at the top of the page during the page load , but it does not seem to affect the menu operation (just hope it works fine with Netscape )
Cheers
Ron WOlpa


Poster: kevin3442
Dated: Saturday April 26 2003 - 7:41:06 BST

Hi Ron,

Just my two cents...

You can bind a Milonic menu to a table cell, using the PlaceMenu() function. I don't know if that would've helped in this instance, however. But by centering the menu using the ScreenPosition property and by cleaning up some of the code in the html and .js, as Mark pointed out, you should be able to easily fit the menu into the context of your page layout... if you want to give it another go.

Cheers,

Kevin


Poster: ronwolpa
Dated: Saturday April 26 2003 - 20:52:41 BST

<td >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<script language=JavaScript>PlaceMenu("menu") </script></td>

Hi Kevin
That´s exactly the solution I adopted.
Using "nbsp; " blanks I realized I can shift the menu little bit more to the left ;
But I think I will replace blanks by a transparent spacer gif ;
Cheers

Ron Wolpa
april 26 2003