Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Wednesday July 18 2012 - 06:07:22
My "mainmenu" displays with no width in Vertical m
Poster: MAXAR RE
Dated: Wednesday October 2 2002 - 23:25:49 BST
When I create a menu then test it, the mainmenu displays as having basically no width, meaning all I see is a tiny, narrow box that has a width of about 4 pixels but has normal height, yet when I mouse-over it, my sub-menus appear fine and have the specified width.
When viewed as a horizontal menu, the mainmenu is only as wide as the text title of the attached submenus, so again I think I am doing something fundamentally wrong. I even went so far as to follow every step on the instruction sheet, but get the same results.
I have tried to monkey around with the "width" and "overall width" fields by inputting values ranging from 2 to 200, but the result is always the same- my mainmenu field is barely visible. This occurs when I click on {roject | Current | Test Current Project, as well as when I copy out the source code and paste it into FrontPage 2000 with your regular JS files from the regular ZIP file, so I do not think it is something specific to just the JS files on the server that the code references (src=/menu/mmenu.js).
I would very much like to figure out what I am doing wrong here and would appreciate any insight or suggestions as I am new to javascript editing, which is why I really like the Menu Builder tool. To assist anyone who is interested in helping to solve this riddle for me, I am inserting the code below.
Thanks!!
<script language=javascript>
/*
Milonic DHTML Menu
Written by Andy Woolley
Copyright 2002 (c) Milonic Solutions. All Rights Reserved.
Plase vist http://www.milonic.co.uk/menu or e-mail menu3 __at__ milonic.com
You may use this menu on your web site free of charge as long as you place prominent links to http://www.milonic.co.uk/menu and
your inform us of your intentions with your URL AND ALL copyright notices remain in place in all files including your home page
Comercial support contracts are available on request if you cannot comply with the above rules.
Please note that major changes to this file have been made and is not compatible with earlier versions..
You no longer need to number your menus as in previous versions.
The new menu structure allows you to name the menu instead. This means that you can remove menus and not break the system.
The structure should also be much easier to modify, add & remove menus and menu items.
If you are having difficulty with the menu please read the FAQ at http://www.milonic.co.uk/menu/faq.php before contacting us.
Please note that the above text CAN be erased if you wish as long as copyright notices remain in place.
*/
//The following line is critical for menu operation, and MUST APPEAR ONLY ONCE.
menunum=0;menus=new Array();_d=document;function addmenu(){menunum++;menus[menunum]=menu;}function dumpmenus(){mt="<script language=JavaScript>";for(a=1;a<menus.length;a++){mt+=" menu"+a+"=menus["+a+"];"}mt+="<\/script>";_d.write(mt)}
//Please leave the above line intact. The above also needs to be enabled if it not already enabled unless you have more than one _array.js file
////////////////////////////////////
// Editable properties START here //
////////////////////////////////////
timegap=500 // The time delay for menus to remain visible
followspeed=5 // Follow Scrolling speed
followrate=50 // Follow Scrolling Rate
suboffset_top=5 // Sub menu offset Top position
suboffset_left=10 // Sub menu offset Left position
test1=[ // test1 is an array of properties. You can have as many property arrays as you need
"FF0033", // Mouse Off Font Color
"FFFFFF", // Mouse Off Background Color (use zero for transparent in Netscape 6)
"FFFFFF", // Mouse On Font Color
"FF0033", // Mouse On Background Color
"C6C3C6", // Menu Border Color
"12", // Font Size (default is px but you can specify mm, pt or a percentage)
"normal", // Font Style (italic or normal)
"bold", // Font Weight (bold or normal)
"Verdana", // Font Name
, // Menu Item Padding or spacing
, // Sub Menu Image (Leave this blank if not needed)
0, // 3D Border & Separator bar
, // 3D High Color
, // 3D Low Color
, // Current Page Item Font Color (leave this blank to disable)
, // Current Page Item Background Color (leave this blank to disable)
, // Top Bar image (Leave this blank to disable)
, // Menu Header Font Color (Leave blank if headers are not needed)
, // Menu Header Background Color (Leave blank if headers are not needed)
, // Menu Item Separator Color
]
addmenu(menu=[
"Links", // Menu Name - This is needed in order for this menu to be called
, // Menu Top - The Top position of this menu in pixels
, // Menu Left - The Left position of this menu in pixels
200, // Menu Width - Menus width in pixels
1, // Menu Border Width
, // Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
test1, // Properties Array - this array is declared higher up as you can see above
0, // Always Visible - allows this menu item to be visible at all time (1=on or 0=off)
, // Alignment - sets this menu elements text alignment, values valid here are: left, right or center
, // Filter - Text variable for setting transitional effects on menu activation - see above for more info
0, // Follow Scrolling Top Position - Tells this menu to follow the user down the screen on scroll placing the menu at the value specified.
0, // Horizontal Menu - Tells this menu to display horizontaly instead of top to bottom style (1=on or 0=off)
0, // Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page (1=on or 0=off)
, // Position of TOP sub image left:center:right
200, // Set the Overall Width of Horizontal Menu to specified width or 100% and height to a specified amount
0, // Right To Left - Used in Hebrew for example. (1=on or 0=off)
0, // Open the Menus OnClick - leave blank for OnMouseover (1=on or 0=off)
, // ID of the div you want to hide on MouseOver (useful for hiding form elements)
, // Background image for menu Color must be set to transparent for this to work
0, // Scrollable Menu
"margin=1;", // Miscellaneous Menu Properties
,"Fullspeed DataBase","http://www.fsdb.net onbordercolor=316AC5;offbordercolor=ffffff;",,"Explore open-wheel racing history at the Fullspeed DataBase",0
,"CompuCom","http://www.compucom.com onbordercolor=316AC5;offbordercolor=ffffff;",,"CompuCom Systems, Inc.",0
,"More Links","show-menu=SubMenu","# onbordercolor=316AC5;offbordercolor=ffffff;",,0
])
addmenu(menu=[
"SubMenu",
,
,
200,
1,
,
test1,
0,
,
,
0,
0,
0,
,
200,
0,
0,
,
,
0,
"margin=1;",
,"CART","http://www.cart.com onbordercolor=316AC5;offbordercolor=ffffff;",,"CART.com",0
])
addmenu(menu=[
"FileMenu",
,
,
200,
1,
,
test1,
0,
,
,
0,
0,
0,
,
200,
0,
0,
,
,
0,
"margin=1;",
,"Search on Google","http://www.google.com onbordercolor=316AC5;offbordercolor=ffffff;",,"Click to Search Google",0
])
addmenu(menu=[
"mainmenu",
20,
20,
100,
1,
,
test1,
1,
,
,
0,
0,
0,
,
,
0,
0,
,
,
0,
"margin=1;",
,"File Menu","show-menu=FileMenu","# onbordercolor=316AC5;offbordercolor=ffffff;",,0
,"Links","show-menu=Links","# onbordercolor=316AC5;offbordercolor=ffffff;",,0
])
dumpmenus();
</script><script language=javascript src=/menu/mmenu.js></script>
<script language=javascript>
self.focus()
</script>
Thanks again!!
Fixed!
Poster: MAXAR RE
Dated: Thursday October 3 2002 - 19:04:03 BST
I took apart the menu_array.js file thatis part of the download, printed it out and compared it line-by-line to my code, then changed my code to match Andy's and VOUALAH!! It works perfectly now!
Here is the corrected code for mainmenu:
addmenu(menu=[ // This is the array that contains your menu properties and details
"mainmenu", // Menu Name - This is needed in order for the menu to be called
20, // Menu Top - The Top position of the menu in pixels
200, // Menu Left - The Left position of the menu in pixels
150, // Menu Width - Menus width in pixels
1, // Menu Border Width
, // Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
test1, // Properties Array - this is set higher up, as above
1, // Always Visible - allows the menu item to be visible at all time (1=on/0=off)
"left", // Alignment - sets the menu elements text alignment, values valid here are: left, right or center
, // Filter - Text variable for setting transitional effects on menu activation - see above for more info
, // Follow Scrolling - Tells the menu item to follow the user down the screen (visible at all times) (1=on/0=off)
0, // Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style (1=on/0=off)
, // Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page (1=on/0=off)
, // Position of TOP sub image left:center:right
, // Set the Overall Width of Horizontal Menu to 100% and height to the specified amount (Leave blank to disable)
, // Right To Left - Used in Hebrew for example. (1=on/0=off)
, // Open the Menus OnClick - leave blank for OnMouseover (1=on/0=off)
, // ID of the div you want to hide on MouseOver (useful for hiding form elements)
, // Background image for menu when BGColor set to transparent.
, // Scrollable Menu
, // Reserved for future use
,"File Menu","show-menu=FileMenu","# onbordercolor=316AC5;offbordercolor=ffffff;",,0
,"Links","show-menu=Links","# onbordercolor=316AC5;offbordercolor=ffffff;",,0
])