Freddie's Spaghetti

“Order One” and “Order Two” are “button-image”
link drop-down menus with two lines of “linked” text each.

1. The code written below is the same code as that used on the Page Three drop-down menus; but now, each drop-down menu has a Window “open()” Method link added to it, as well as there being a change to one of the second menu's “default” menu settings.

The “default” menu settings are stored in the main “Menu()” function in the external “mm_menu.js” JavaScript file.


<script type="text/javascript">

// <![CDATA[

function mmLoadMenus() {

if (window.first_menu) return;

window.first_menu = new Menu("root",79,16,"Arial, Helvetica, sans-serif",10,
"#000000","#FFFFFF","#99FFCC","#000000","left","middle",3,0,1000,-5,7,true,true,
true,0,true,true); first_menu.addMenuItem("Spaghetti",
"window.open('http://www.quinziegabrieli.it/');"
); first_menu.addMenuItem("Little&nbsp;Salad",
"window.open('salad1.html','','toolbar=0,scrollbars=0,location=0,statusbar=0,
menubar=0,resizable=0,width=270,height=430');"
); window.second_menu = new Menu("root",79,16,"Arial, Helvetica, sans-serif",10,
"#000000","#FFFFFF","#99FFCC","#000000","left","middle",3,0,1000,-5,7,true,true,
true,0,true,true);   second_menu.addMenuItem("Ravioli",
"window.open('http://www.ilsaraceno.com/');"
); second_menu.addMenuItem("Big&nbsp;Salad",
"window.open('salad2.html','','toolbar=0,scrollbars=0,location=0,statusbar=0,
menubar=0,resizable=0,width=600,height=600');"
); second_menu.fontWeight='bold'; writeMenus(); } // ]]> </script>

[Window open() Method added] Component 1


To add a Window “open()” Method link to a menu, just place it where you placed the “location=” link information inside of the “addMenuItem();” function's parentheses. [See Page Three - Component 1.]

For a simple explanation of this complicated-looking Window “open()” Method, you can go to this W3Schools.com web page. There you will see a complete list of the “parameters” that you have to add to the “open()” Method in order to get a browser to “resize” a new window.

You may have noticed above that there is a “second_menu.fontWeight='bold';” code-line as part of the second menu's code-packet. That code-line is used to change a “default” menu setting stored in the main “Menu()” function in the external “mm_menu.js” JavaScript file. The text on the “Order Two” drop-down menu has now been changed to a “fontWeight” of “bold” due to this added code-line.

As you can see below, the “default” setting for “fontWeight” in the main “Menu()” function is designated as “plain.”

The “default” settings are not affected by the 22 “arguments” that the main “Menu” function accepts from the “mmLoadMenus()” function. [See Page Two - Component 1.] You will have to make the changes to the “default” settings yourself using the above coding method.


function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to,
sx, sy, srel, opq, vert, idt, aw, ah) { this.version = "020320 [Menu; mm_menu.js]"; this.type = "Menu"; this.menuWidth = mw; this.menuItemHeight = mh; this.fontSize = fs; this.fontWeight = "plain"; this.fontFamily = fnt; this.fontColor = fclr; this.fontColorHilite = fhclr; ...

[main Menu() function] Component 4


Now, let's head over to Page Five for a look at the “z-index” levels as they are set in the external “mm_menu.js” JavaScript file.

To Top of Page

This page displays properly in Firefox 29.0.1, Google Chrome, and Internet Explorer-9 browsers.