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:44

Individual itemwidth's for each main menu item [Solved]


Poster: thayvian
Dated: Monday January 15 2007 - 10:06:43 GMT

Hello everyone,

I don't see a way to specify different itemwidths for each of my main menu items. I only notice how the command itemwidth changes all the widths across the navbar. Any help would be greatly appreciated, thanks!

--Thayvian


Poster: Ruth
Dated: Monday January 15 2007 - 23:02:29 GMT

Hi,

http://www.milonic.com/styleproperties.php

This will set itemwidths the same for all menus that use the particular style where it is declared.

http://www.milonic.com/menuproperties.php

This will more or less do the same as the one with the styleproperties.

http://www.milonic.com/itemproperties.php

This applies the properties in the item and will only set it in that particular item.

Ruth

Re: Individual itemwidth's for each main menu item


Poster: pedboy
Dated: Wednesday March 12 2008 - 19:02:27 GMT

Perhaps i am being dumb here but i cant seem to make that work for me.


My site is here http://www.locodocs.co.uk

Ideally i want to add extra "top level" options to my menu without spreading the text over two lines - I would like to reduce the amount of space taken by the "Home" and "Misc" buttons to squeeze in the extra option, however if i try to do this the text wraps on the longer names whilst the home button shrinks a but, but not as much as it might.


Any ideas on how i can achive this?

if i " // " the "itemwidth" line for the top level everything squashes up but then there is a huge amount of dead space on the right (menu is alligned left)


menu files are available in the menu directory directly off the http://www.locodocs.co.uk/ thingy!

Re: Individual itemwidth's for each main menu item


Poster: Ruth
Dated: Thursday March 13 2008 - 0:20:21 GMT

Hi,

itemwidth is also an item property so you can specify the width in each item, i.e. itemwidth=100; Below my names are links for different groups of properties, style, menu and item. Some of them pertain to just one level, i.e. margin, which is only a menu property. Some can pertain to two, and some to all three. So, you can code each main menu item with its own width.

Ruth

Re: Individual itemwidth's for each main menu item


Poster: pedboy
Dated: Thursday March 13 2008 - 8:53:11 GMT

Ruth wrote:
Hi,

itemwidth is also an item property so you can specify the width in each item, i.e. itemwidth=100; Below my names are links for different groups of properties, style, menu and item. Some of them pertain to just one level, i.e. margin, which is only a menu property. Some can pertain to two, and some to all three. So, you can code each main menu item with its own width.

Ruth


Okay i really am being dumb now!

Here is the bit of code for my top level...

Code:

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=0;
orientation="horizontal";
style=menuStyle;
top=0;
menuwidth="904px";
menualign="left";
itemwidth=100;
aI("text=Home;url=http://www.locodocs.co.uk/;");
aI("showmenu=Repair Books;text=Repair Books;");
aI("showmenu=Manufacturers Manuals;text=Manufacturers Manuals;");
aI("showmenu=BR Driver's Manuals;text=BR Driver's Manuals;");
aI("showmenu=Maintenance Guides;text=Maintenance Guides;");
aI("showmenu=Misc;text=Misc;");
}


Now if i change the itemwidth setting to say 50 it changes all of the menu top levels to 50.

What i want is to have say
Home = 50
Repair Books 100
Man Manuals 120
Misc 50

etc

Im sure this must be possible but im not sure where to stick the property.

It is the actual with of the menu button un-expanded that i want to change - i understand how to change the width of the drop-downs.

Re: Individual itemwidth's for each main menu item


Poster: John
Dated: Thursday March 13 2008 - 14:17:05 GMT

As Ruth explained, by placing the itemwidth=100; where you have it now you are setting that value for that entire menu. Not what you want. You're after the individual items, so it would seem to make sense to set the property for each individual item within that menu...
Code:
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=0;
orientation="horizontal";
style=menuStyle;
top=0;
menuwidth="904px";
menualign="left";
aI("text=Home;url=http://www.locodocs.co.uk/;itemwidth=50;");
aI("showmenu=Repair Books;text=Repair Books;itemwidth=100;");

etc.

Please take another (or a first :D ) look at the reading she suggested.

Re: Individual itemwidth's for each main menu item


Poster: pedboy
Dated: Thursday March 13 2008 - 20:21:20 GMT

John wrote:
As Ruth explained, by placing the itemwidth=100; where you have it now you are setting that value for that entire menu. Not what you want. You're after the individual items, so it would seem to make sense to set the property for each individual item within that menu...
Code:
with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=0;
orientation="horizontal";
style=menuStyle;
top=0;
menuwidth="904px";
menualign="left";
aI("text=Home;url=http://www.locodocs.co.uk/;itemwidth=50;");
aI("showmenu=Repair Books;text=Repair Books;itemwidth=100;");

etc.

Please take another (or a first :D ) look at the reading she suggested.


I didnt realise i could slip it into each line like that - i was trying to add it further down the code.

I have read the listing of attributes but wasnt sure how to implement them - basically where to stick them. But as ive never done anything like this before, nor have i had any IT training so i am just learing as i go (when i was at school we had BBC Micros!) im pretty chuffed with myself having got this far :-)

But once again many thanks.... Does the message board have a collections pot/charity where one can deposit a few quid to help pay for the upkeep/say thanks?

Re: Individual itemwidth's for each main menu item


Poster: Ruth
Dated: Thursday March 13 2008 - 21:53:34 GMT

Hi,

Those links below my name for the different properties, each one pertains the thing upon which it works and the place you can put it in the data file. So, styleproperties are ones you would put in the style section, menuproperties in the menu section i.e. the part that defines the menu, not the items, like alwaysvisible=;style=;top=; area, and then itemproperties are those that you can put directly into an item. So, let's say you wanted one item to have more padding and to have bold text, since those properties can be either a style property or an item property you could set them in the style section and then in that one item you would put padding=whatever;fontweight=bold; and that item would have more padding and it would have bold.

So, you can really fine tune things in the menu. As to your item widths, let's say you want them to be 100, but you want one to be smaller, then you'd code itemwidth=100; in the menu area and then in the item you want smaller you'd code itemwidth=50; or whatever you want. That should override the one set in the menu for that particular item. Hope that clears things :)

I think you need to contact Milonic about that pot/charity since it is their board. There might be some kind of revenue issue or something as a reason they don't do it.

Ruth

Re: Individual itemwidth's for each main menu item


Poster: pedboy
Dated: Thursday March 13 2008 - 23:29:06 GMT

Yup i get it now and understand, as i am sure you can see if you look at the site.

Im just fine tuning it now :-) Im rather moer chuffed now :-)



Thanks all :-)