| 1. To define the menus' content |
| You are using the s_add() function for adding menus. The last parameter you send to this function is an array. This array contains some two-item arrays, any of which in fact is the definition for the current menu item. In the first item write the href for the menu
item and in the second the text to be displayed.
NOTES : - The links should be addresses to which the user will be navigated in the current window or in new one (change the s_target variable in section 1 of s_arrays.js). - However you can make exceptions & override the s_target variable for any link you want. Do the following: the link should look like this '*theTarget*theActualLink'. theTarget may be self, top , newWindow or any frame name. For example: '*self*http://www.yahoo.com' means that the Yahoo page will be loaded in the current window, '*top*http://www.yahoo.com' means that the Yahoo page will be loaded in the top window (useful with frames), '*newWindow*http://www.yahoo.com' means that the Yahoo page will be loaded in new window & '*main*http://www.yahoo.com' means that the Yahoo page will be loaded in the frame named main. - The links can call javascript functions if they look like this 'javascript:theFunctionHere()'. - You can have SELECTED (with a special style, defined in the STYLESHEETS) and NOROLL (without rollover) menu items. To have such item simply set its' href to 'SELECTED' or 'NOROLL'. In v4.6.x of the script such item could not have link or show sub menu. Now you can add link or show sub menu by using the following syntax '[show:NAME;]SELECTEDorNOROLL[;linkInfo]'. The parts between "[" & "]" are optional and any may be missing. For example: 'show:downloads;SELECTED;*self*downloads.html' means that the item will be SELECTED, if the mouse goes over it, the menu named "downloads" will be shown and if clicked, the "downloads.html" will be loaded in the current window.
Go to the MENU DEFINITIONS section of the s_arrays.js and copy & paste one of the added menus. After that change anything you need in the parameters (name, level, placement...) and the menu will be created. After that it can be called by another menu or if is a first level- shown with the s_show('NAME',event) function.
Go to the MENU DEFINITIONS section of the s_arrays.js and delete the menu you want.
| 4. To define the menus' position |
| In the s_add() function when adding menus you define the top and left placement of each menu. The default value of the TOP and LEFT is ' ' (empty quotes). When it's leaved untouched the menu will be shown at the place where the mouse event occurred. If you want to absolutely position any menu, set integer value (pixels) to the TOP and LEFT and don't use quotes. You can also use the mouseY and mouseX keywords for positioning the menus. For example 'mouseY+20' for TOP and 'mouseX+20' for LEFT means that the menu will pop on 20 pixels below and on the right of the mouse event. There's no difference between ' ' and 'mouseY' or 'mouseX'. You can also use a special function as a keyword, which for example may return the page middle and this way center align your menu. Use your imagination according to your needs. Example can be found in the "Samples -> Relative Position -> Non-permanent menus" folder.
NOTE: The above notes matter only for LEVEL 1 and non-permanent menus. For all menus which are not LEVEL 1 (are subs) leave the TOP and LEFT value ' '. For permanent menus you can use integer values (absolute positioning). To learn how to relatively position any permanent menu look at the "Samples -> Relative Position -> Permanent menus" folder.
| 5. To hide elements that are in the "menus' way" |
| This feature has been removed in v4.0+ of the SmartMenus script due to the small interest and the difference in the browser performance. If someone needs this let him call me. You'd better keep your menus away from form elements and embeds.
| 6. Showing/Hiding of the sub menus |
| If you want any of the items of any menu to show submenu set its' href to 'show:NAME' where NAME is the name of the menu to show. You can still add link to the item or make it SELECTED or NOROLL by using this syntax 'show:search[;SELECTEDorNOROLL][;*newWindow*http://www.yahoo.com/]'. The parts between "[" & "]" are optional and any may be missing. You have to separate the different parts with ";" (semi-colon).
| 7. To add custom status bar description text for any menu item |
| You can easily add custom status bar description text to any menu item by adding a third array item to the array, which defines the menu item. Sounds a bit confusing but here's a simple example of a menu item with custom status bar description text: ['http://www.yahoo.com/','Yahoo!'[,'Visit the Yahoo! home page']] The part between "[" & "]" is the status bar description text and is optional & may be missing. If custom status bar description text is not specified for the menu item, the link will be displayed in the status bar instead. |
|