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

Menu Bugs: Missing px declaration in menu


Poster: luegner
Dated: Monday December 26 2005 - 16:44:21 GMT

Seamonkey 1.0b and Firefox 1.5 complain about missing px declarations in the latest version (5.738) of the menu.

Here are the offending lines:

_fsize=(_I[12]?";font-Size:"+_I[12]:Z$);

->

_fsize=(_I[12]?";font-Size:"+_I[12]+"px":Z$);

in $z function:

$S.width=$T

->

$S.width=$T+"px";


Poster: luegner
Dated: Monday December 26 2005 - 17:12:37 GMT

Never mind. I'm retarded. I forgot to put in px after setting the values myself. Perhaps a possible enhancement would be to get the substr of the last two characters of the value and if they're not "px" and the value is not empty, then append px to the value.

Standard for declaring pixel values


Poster: luegner
Dated: Monday December 26 2005 - 17:26:39 GMT

This menu is a bit quirky when declaring px values. In some places, it's allowed and in those cases required and in other places, if you declare it, it breaks what it's supposed to be setting. For all values that can have px appended to them, the menu should intelligently check to see if the px value exists first and if it doesn't, then it should append it.

An example of this quirk would be that you have to set "px" after the number value for menuwidth, it will throw an error, but if you set it after left or top, it breaks the absolute positioning ability.


Poster: luegner
Dated: Monday December 26 2005 - 18:22:54 GMT

Actually it looks like $S.width=$T really should be changed. It looks like this value gets set when no menuwidth is set. $T doesn't already have "px" appended to it, so that really is a bug.


Poster: Andy
Dated: Wednesday January 4 2006 - 11:39:55 GMT

Have you got a copy of your menu_data.js that Firefox complains about.

All px values should be inserted automatically if required, there is a function for it.

-- Andy

Menu Data Copy


Poster: luegner
Dated: Monday January 16 2006 - 17:07:34 GMT

Here's the good one:

_menuCloseDelay=100;_menuOpenDelay=100;_menuOpenDelay=100;_followSpeed=5;_followRate=0;_subOffsetTop=10;_subOffsetLeft=-10;_scrollAmount=3;_scrollDelay=20;retainClickValue=1;fixMozillaZIndex=true;
with(RootMenuStyle=new mm_style()){
borderstyle="solid";fontsize="12px";fontstyle="normal";fontweight="normal";fontfamily="Arial, Helvetica, sans-serif";padding="2";swap3d="1";pagecolor="#ffffff";pagebgcolor="#000000";headercolor="#000000";headerbgcolor="#FF0000";separatorcolor="#2E2C26";separatorsize="1";overfilter="Fade(duration=0.2);Alpha(style=0,Opacity=100);Shadow(color=000000, Direction=133, Strength=0);";outfilter="randomdissolve(duration=0.3)";
}
MainMenuStyle=new copyOf(RootMenuStyle)
MainMenuStyle.itemwidth="150";MainMenuStyle.align="center";MainMenuStyle.offcolor="#ffffff";MainMenuStyle.offbgcolor="#006600";MainMenuStyle.oncolor="#ffffff";MainMenuStyle.onbgcolor="#009900";MainMenuStyle.bordercolor="#000000";MainMenuStyle.borderwidth="1";MainMenuStyle.subimage="/images/arrow_right.gif";MainMenuStyle.subimagepadding="0";MainMenuStyle.subimageposition="right";MainMenuStyle.high3dcolor="#C6C2B9";MainMenuStyle.low3dcolor="#2E2C26";
SubMenuStyle=new copyOf(RootMenuStyle)
SubMenuStyle.itemwidth="150";SubMenuStyle.align="center";SubMenuStyle.offcolor="#ffffff";SubMenuStyle.offbgcolor="#006600";SubMenuStyle.oncolor="#ffffff";SubMenuStyle.onbgcolor="#009900";SubMenuStyle.borderwidth="1";SubMenuStyle.subimage="/images/arrow_right.gif";SubMenuStyle.subimagepadding="0";SubMenuStyle.subimageposition="right";SubMenuStyle.high3dcolor="#C6C2B9";SubMenuStyle.low3dcolor="#2E2C26";
with(dynamicmenu=new menuname("mainMenu")){
top="150";left="4";style=MainMenuStyle;menuwidth="150px";alwaysvisible=1;followscroll=1;orientation="vertical";keepalive=1;openstyle="ltr";overflow="scroll";
aI("text=Home;url=index.htm;");
}

Here's the one with px omitted in menuwidth (the one that throws an error). Also if I omit px from fontsize, it will also throw an error. Is that by design?

_menuCloseDelay=100;_menuOpenDelay=100;_menuOpenDelay=100;_followSpeed=5;_followRate=0;_subOffsetTop=10;_subOffsetLeft=-10;_scrollAmount=3;_scrollDelay=20;retainClickValue=1;fixMozillaZIndex=true;
with(RootMenuStyle=new mm_style()){
borderstyle="solid";fontsize="12px";fontstyle="normal";fontweight="normal";fontfamily="Arial, Helvetica, sans-serif";padding="2";swap3d="1";pagecolor="#ffffff";pagebgcolor="#000000";headercolor="#000000";headerbgcolor="#FF0000";separatorcolor="#2E2C26";separatorsize="1";overfilter="Fade(duration=0.2);Alpha(style=0,Opacity=100);Shadow(color=000000, Direction=133, Strength=0);";outfilter="randomdissolve(duration=0.3)";
}
MainMenuStyle=new copyOf(RootMenuStyle)
MainMenuStyle.itemwidth="150";MainMenuStyle.align="center";MainMenuStyle.offcolor="#ffffff";MainMenuStyle.offbgcolor="#006600";MainMenuStyle.oncolor="#ffffff";MainMenuStyle.onbgcolor="#009900";MainMenuStyle.bordercolor="#000000";MainMenuStyle.borderwidth="1";MainMenuStyle.subimage="/images/arrow_right.gif";MainMenuStyle.subimagepadding="0";MainMenuStyle.subimageposition="right";MainMenuStyle.high3dcolor="#C6C2B9";MainMenuStyle.low3dcolor="#2E2C26";
SubMenuStyle=new copyOf(RootMenuStyle)
SubMenuStyle.itemwidth="150";SubMenuStyle.align="center";SubMenuStyle.offcolor="#ffffff";SubMenuStyle.offbgcolor="#006600";SubMenuStyle.oncolor="#ffffff";SubMenuStyle.onbgcolor="#009900";SubMenuStyle.borderwidth="1";SubMenuStyle.subimage="/images/arrow_right.gif";SubMenuStyle.subimagepadding="0";SubMenuStyle.subimageposition="right";SubMenuStyle.high3dcolor="#C6C2B9";SubMenuStyle.low3dcolor="#2E2C26";
with(dynamicmenu=new menuname("mainMenu")){
top="150";left="4";style=MainMenuStyle;menuwidth="150";alwaysvisible=1;followscroll=1;orientation="vertical";keepalive=1;openstyle="ltr";overflow="scroll";
aI("text=Home;url=index.htm;");
}