NOTE: This section is important and may be a little bit difficult to understand if you know nothing about JavaScript. Read carefully.
A menu system contains submenu systems and/or menu options. When creating a menu system, start with the following line.
m = menu_pointer
Where
- menu_pointer is a JavaScript pointer pointing to the menu system. For example:
menu_pointer always starts with menus[0] and ends with menus
points to the main program menu system. - menus[0].menus
points to the THIRD menu system under the main program menu system. - menus[0].menus[2].menus
points to the FIFTH menu system under the above menu system. - menus[0].menus[2].menus[4].menus
To define a submenu system/menu option under a menu system, add the following line.
m[m.length] = new Menu("name", icon_num[, "action"])
Where
- name is the name of the submenu system/menu option inside the menu system.
- icon_num is the number representing the icon to be displayed.
- action is the action to be performed if it is a menu option. It can be a valid URL path or a JavaScript command. If it is a JavaScript command a space MUST be inserted in the front. This parameter can be ignored if the current item is a submenu system.
Take a look at the following examples.
m = menus[0].menus
m[m.length] = new Menu("This is a submenu system.", 0)
m[m.length] = new Menu("This is a menu option.",1, "http://animetheme.simplenet.com/")
The above code creates the main program menu system with one submenu system and one menu option.
m = menus[0].menus[0].menus[1].menus
m[m.length] = new Menu("This is a submenu system.", 0)
m[m.length] = new Menu("This is a menu option.",1, " test()")
The above code creates the SECOND menu system under the FIRST menu system of the main program menu system with one submenu system and one menu option which will run a JavaScript function when clicked.
Return to Dynamic HTML Resource Center