Problem with "menuwidth" variable (change from RC1

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Marc-Andre.Roberge@mus.ul
Super Advanced
Super Advanced
Posts: 47
Joined: Sun May 19, 2002 7:23 pm
Location: Québec, QC, Canada
Contact:

Problem with "menuwidth" variable (change from RC1

Post by Marc-Andre.Roberge@mus.ul »

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: Select all

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.");
...
}
Marc-Andre.Roberge@mus.ul
Super Advanced
Super Advanced
Posts: 47
Joined: Sun May 19, 2002 7:23 pm
Location: Québec, QC, Canada
Contact:

Post by Marc-Andre.Roberge@mus.ul »

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: Select all

menuwidth="100%";
menualign="left";
and use the following for my last menu entry

Code: Select all

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: Select all

function menuname(name) ... _t.menuwidth=_n;
and

Code: Select all

_x[27]=_t.menuwidth
However, in RC20, I find only

Code: Select all

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>.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

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.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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: Select all

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:
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
Marc-Andre.Roberge@mus.ul
Super Advanced
Super Advanced
Posts: 47
Joined: Sun May 19, 2002 7:23 pm
Location: Québec, QC, Canada
Contact:

Post by Marc-Andre.Roberge@mus.ul »

Kevin,

Thank you so much for finding this simple solution to my problem. I have found that the commands

Code: Select all

borderwidth=1; bordercolor="#cc9933";
must appear below

Code: Select all

with(menuStyle=new mm_style()){ 
and not below

Code: Select all

with(milonic=new menuname("Main Menu")){
. The two commands I have under the second line above --

Code: Select all

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.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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.
John
Post Reply