October 13th, 2009New AllWebMenus property: Show item or group on Appear
When the menu initially appears on the page, you can have an item shown as "selected" (highlighted) or a group appear open.
See an online example:
http://www.likno.com/examples.html?example=show_item_group_on_appear
This new property is found here:


There are 3 options to achieve this:
(NOTE: PLEASE READ THE RELATED ALLWEBMENUS HELP TOPIC FOR MORE INFO AND SCREENSHOTS)
Option 1 (automatically, item selected based on URL)
(applies for item highlighting only)
Check this option and the menu will display as selected (highlighted) the first item whose <Link> property matches the URL of the loaded page.
Note: If more than one menu item links to the same page (URL) then all matching items will be highlighted.
For more info on how this feature works please read the HELP topic of this property in AllWebMenus.
Option 2 (manually, standard item/group in all pages using the menu)
(applies for both item and group highlighting)
Check this option and the menu will display as selected (highlighted) the specific item or group that you choose from the interface.
The item or group is specified by its unique ID (see the AllWebMenus HELP topic).
You may also use a group ID (instead of an item ID) if you just want to start your menu with a submenu already open but without any of its items being selected.
If the specified item is within a submenu group then the submenu appears open and shows the item as selected.
If you specified a group instead, then the group appears open but without any of its items shown as selected.
Option 3 (manually, custom item/group per page through a page variable)
(applies for both item and group highlighting)
This allows you to control which item shows as selected (or which group appears open) dynamically through the HTML of your web page.
You do not have to check any option in the interface, just add the following code in a single line before the menu-linking code of your web page (the menu constructor):
<script type="text/javascript">var awmShowItem=["menuname,ID,Over_Click"];</script>
where:
menuname is the name of the compiled file without the ".js" extension
( example: if you compile as "menu.js" then use menu as the value for that parameter )
ID is the ID of the item (or group) that will appear as initially selected
( example: it4 OR gr2 )
Over_Click is a number that applies for item IDs only (not group IDs) and specifies whether the "Mouse Over" or "Mouse Click" state is used to show the item as selected.
It takes the value "1" or "2" (without quotes):
1 for "Mouse Over"
2 for "Mouse Click"
Example for an item:
<script type="text/javascript">var awmShowItem=["menu,it1,2"];</script>
This means: The item with ID "it1" from the menu compiled as "menu.js" will show as selected using its "Mouse Click" state.
Example for a group:
<script type="text/javascript">var awmShowItem=["menu,gr1"];</script>
This means: The group with ID "gr1" from the menu compiled as "menu.js" will show open when the menu loads.
Example for selected items/groups on multiple menus!:
This feature even supports multiple menus on the same page, as follows:
<script type="text/javascript">var awmShowItem=["menu1,it4,1", "menu2,gr3", "menu3,it8,2"];</script>
This means:
- The item with ID "it4" from the menu compiled as "menu1.js" will show as selected using its "Mouse Over" state.
- The group with ID "gr3" from the menu compiled as "menu2.js" will show open when the menu loads.
- The item with ID "it8" from the menu compiled as "menu3.js" will show as selected using its "Mouse Click" state.
PLEASE READ THE RELATED ALLWEBMENUS HELP TOPIC FOR MORE INFO AND SCREENSHOTS!
ALSO CHECK THE LIVE EXAMPLE WITHIN ALLWEBMENUS.
(keywords: 'keeping submenus open', 'always visible')