NOTE: This section is important and may be a little bit difficult to understand if you know nothing about JavaScript. Read carefully.
First of all you need to define the number of items inside the main program menu(not including any submenus or menu options under the main program menu). Start with the following line.
menu = new menuSystem(#_of_items)
Where
- #_of_items is the number of items inside the main program menu.
For each submenu, add the following line.
menu[][][menu_num] = new subMenu("name", icon_num, #_of_items)
Where
- menu_num is the number representing this item in the current menu system.
- name is the name of this item.
- icon_num is the number representing the icon to be displayed.
- #_of_items is the number of items in this menu system.
For each menu option, add the following line.
menu[][][menu_num] = new menuOption("name", icon_num, "action")
Where
- menu_num is the number representing this item in the current menu system.
- name is the name of this item.
- icon_num is the number representing the icon to be displayed.
- action is the action to be performed. Start with "open:" if it represents a HTML document. Start with "mailto:" if it represents an email link. Start with "javascript:" if it represents a JavaScript command line.
NOTE: The object menu is accessed like a multi-demensional array. For example, menu[0] represents the FIRST item of the main program menu, menu[4][6] represents the SEVENTH item of the FIFTH submenu of the main program menu.
You should present items of the same menu level in descending order ie. items with larger menu_num should be placed prior to items with smaller menu_num.
Take a look at the following example.
menu = new menuSystem(3)
memu[2] = new subMenu("This is a submenu system.",0, 2)
menu[1] = new menuOption("This is a menu option.",1, "open:http://animetheme.simplenet.com/")
menu[0] = new menuOption("This is a menu option.",1, "open:http://animetheme.simplenet.com/")
The above code creates the main program menu system with one submenu system(cotaining two items) and two menu options.
Return to Dynamic HTML Resource Center