|
home / documentation / reference / topupondisplay
TopUponDisplay
- Description:
- JavaScript code to be executed each time the menu is
displayed as a top level menu.
- Value:
- null, or String JavaScript expression.
- Applies To:
- Menus.
- Browser Compatibility:
- TopUponDisplay is supported in all browsers.
- Comments:
- This parameter defines JavaScript code that should be executed
when the menu is being displayed as a top level menu. Compare this parameter
to ChildUponDisplay, which defines
JavaScript code that should be executed when the menu is being displayed as
a child menu. A single menu can be used as both a top level menu and a child
menu on the same page. This Child vs. Top distinction allows
you to define different JavaScript code depending on how the menu is currently
being utilized.
When using a String JavaScript expression (i.e., a JavaScript expression
contained within quotes), that expression will not be evaluated until
just before the menu is displayed. It will then be reevaluated every time
the menu is redisplayed.
HierMenus version 6 provides a custom function in the HM_Loader.js
file that can be particularly useful when called from the UponDisplay
and UponHide parameters: HM_f_ToggleElementList, which allows
you to hide select elements, or other windowed page elements
that may be overlapping your menus (see FAQ #1).
A detailed explanation of HM_f_ToggleElementList along with a working
example can be found in Bulletin 6. Another common
use of TopUponDisplay and TopUponHide is to synchronize link
rollover effects with the appearance and hiding of menus. This topic is discussed
in detail in Bulletin 12.
- Examples:
// Ok:
TopUponDisplay:null, // cancel inherited UponDisplay
TopUponDisplay:"HM_f_ToggleElementList(false,['select'],'tag')",
// hide all select elements
// Incorrect:
TopUponDisplay:"null", // no quotes around null
TopUponDisplay:HM_f_ToggleElementList(false,['select'],'tag'),
// must have quotes around String JavaScript Expressions
- Default:
- null
- See Also:
-
TopUponHide,
ChildUponDisplay,
ChildUponHide,
Bulletin 6: Hiding Page Elements,
Bulletin 12: Synchronizing Link Rollovers
|