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

Problem with "menuwidth" variable (change from RC1


Poster: Marc-Andre.Roberge __at__ mus.ul
Dated: Wednesday November 5 2003 - 22:07:25 GMT

I had finally found how to use the menuwidth="100%" command to cause the menu bar to extend to the right edge of the screen a few RCs ago. Now, I just installed RC20 and the menu bar now stops at the end of the last main menu item. Has the command been broken? I was forced to revert to RC18. My code reads as follows:

Code:
with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=158;
alwaysvisible=1;
orientation="horizontal";
//Following two lines added to make menu fill entire screen
menuwidth="100%";
menualign="left";

aI("text=Personnes;showmenu=personnes;status=Noms de personnes : orthographe, signes diacritiques, traits d\'union, particules, titres de noblesse, pseudonymes, translittération, etc.");
...
}


Poster: Marc-Andre.Roberge __at__ mus.ul
Dated: Thursday November 6 2003 - 15:40:13 GMT

With regard to my previous post, which has found no response yet, I would like to add:

First, the documentation at <http://www.milonic.co.uk/itemproperties.php> no longer contains any text next to the "menuwidth" variable. Should I understand that it is no longer fully functional?

Second, if I comment out the lines

Code:
menuwidth="100%";
menualign="left";


and use the following for my last menu entry

Code:
aI("text=;itemwidth=100%;onbgcolor=#cc9933;offbgcolor=#cc9933;oncursor=default");


my main menu, with RC20, extends to the right edge of the screen, as it did previously (with RC18). This "itemwidth" trick, which seems to have been an interim solution, had been suggested to me a few weeks ago as a solution. I then changed to "menuwidth" when this was fully supported. For some reason I cannot understand, this command no longer seems to work.

When looking at the milonic_scr.js code for RC18, I find the following:

Code:
function menuname(name) ... _t.menuwidth=_n;


and

Code:
_x[27]=_t.menuwidth


However, in RC20, I find only

Code:
function mm_style(){for(i in _$S)this[i]=_n}_$M= ...
menuwidth:17


Could this major difference explain with the command no longer seems to work? As far as I know, I am following the directions set out in <http://www.milonic.co.uk/menusample.php?sampleid=26>.


Poster: Hergio
Dated: Friday November 7 2003 - 3:58:25 GMT

Yes, the code underwent some major changes in the last release. I am sure the itemwidth = 100% will be fixed as it has very well documented value to users of the menu. Make sure you have posted this bug to the BUGS sticky at the top of this forum...just mention the bug, breifly what you tried and leave it at that, Andy will use that thread as a way to wade through the bugs. Thanks for the heads up.


Poster: kevin3442
Dated: Tuesday November 11 2003 - 17:42:18 GMT

Marc-Andre,

It seems that the menuwidth property must rely at least in part on the menu's border. If the menu has no border, then menuwidth="100%" won't work. I think you can solve your problem by adding the following to your menuStyle:
Code:
borderwidth=1;
bordercolor="#cc9933";

I am assuming (according to what you have currently commented out) that you want the menu to look like it has no border, so the border color in the above example matches your offbgcolor.

In the Bug thread, you said:
Quote:
Curiously, as soon as I revert to RC18, things always come back to normal (even though the sample page no. 26 displays correctly, which is a mystery to me!).

I believe the borderwidth issue explains why the sample works; it has a border.

Hope that helps,

Kevin


Poster: Marc-Andre.Roberge __at__ mus.ul
Dated: Tuesday November 11 2003 - 20:53:08 GMT

Kevin,

Thank you so much for finding this simple solution to my problem. I have found that the commands
Code:
borderwidth=1; bordercolor="#cc9933";
must appear below
Code:
with(menuStyle=new mm_style()){
and not below
Code:
with(milonic=new menuname("Main Menu")){
. The two commands I have under the second line above --
Code:
menuwidth="100%"; menualign="left";
-- must still be present for the intended effect to be produced.

What strikes me is that up to RC18 I could obtain the desired effect without these additional commands.


Poster: John
Dated: Tuesday November 11 2003 - 23:04:28 GMT

Note that both borderwidth and bordercolor are, in fact, style attributes. As such, they must by used in the style definition, not the menu definition.

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