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: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:54

wanted: 5 mainitems each 20% width


Poster: vlerk __at__ chello.nl
Dated: Thursday November 27 2003 - 15:24:28 GMT

Hi,

I try to make a horizontal menu with 5 mainitems each 20% width so they wil scale. Now the mainitems are images 150px width, and I would like (comparing with table) the 'cells' to be 20% each.

[/url]http://www.oplijn.nl/sp_mimenu[url]

I studied several samples but did not succeed. Maybe someone here has a clue.

Grea[/url]


Poster: vlerk __at__ chello.nl
Dated: Thursday November 27 2003 - 15:27:54 GMT

http://www.oplijn.nl/sp_mimenu


Poster: kevin3442
Dated: Saturday November 29 2003 - 5:27:41 GMT

Hi Grea,

As far as I know, the itemwidth property doesn't support widths specified as percentages (I just tried it, and it didn't work). The description of itemwidth says:
Quote:
itemwidth is an optional property that will fix the width of a menu based on declared pixel values. If this value is ommited, the menu will calculate the best width to use.

It seems to be specific to number of pixels. Percentages would be a nice touch though.

One option you could try is, in the main menu definition, remove any itemwidth setting, and define:
Code:
menuwidth="100%";
menualign="center";

Your main menu bar would span the entire width of the browser window, with the "active" part of the menu centered, and with extra space added equally to the left and right sides. As you make the window narrower, the extra space on either side would shrink, and the menu items themselves would remain centered on the page. Similarly when making the window wider... extra space added equally to either side, with the menu items centered in the page.

Kevin


Poster: vlerk __at__ chello.nl
Dated: Tuesday December 2 2003 - 9:43:03 GMT

Thanks for your answer Kevin.
I did try those possibilities before posting the question and was hoping I missed a clue in the 100% span sample.

Precentage-itemwidth would be great indeed, for now I have to think of something else.
May be do some expiriments with 5 (main) menu's in a row... Anyone done this before?

Grea


Poster: vlerk __at__ chello.nl
Dated: Tuesday December 2 2003 - 20:41:18 GMT

Tadaaaaaa it's working.

Using the 'Relative Positioning / Table Bound' sample I achieved what I was looking for. Don't know what I did wrong last week but who cares.

So it is possible to give the mainmenuitems a % width using the traditional tablecells with css.

Grea