|
home / documentation / reference / displaytext
DisplayText
- Description:
- The text to display within the menu item.
- Value:
- String, null, or JavaScript expression that returns
a String/null.
- Applies To:
- Menu Items.
- Browser Compatibility:
- DisplayText is supported in all browsers.
- Comments:
- You may include embedded HTML within your menu item text, but
if you do so, you should do so sparingly. One common use of embedded HTML in
menu items is to include images via the HTML <img> tag. See
FAQ #2 for further details. Embedded images may also
have a rollover effect. See the setup instructions
for further information on this.
In HierMenus versions prior to version 6, it was common to embed HTML in menu item text
to apply specific font sizes to menu items (or font sizes other than points),
text alignment of menu item content (such as <center>), or style
sheet based styling of menu items. Each of these possibilities is now handled
natively by HierMenus, so such uses of embedded HTML are no longer necessary (and
are no longer recommended). In fact, one particular case--that of aligning text
using embedded HTML alignment directives--will no longer work properly in
all situations and all browsers (especially Netscape 4). Use the
TextAlign parameter for this, instead.
- Examples:
// Ok:
DisplayText:"Products",
DisplayText:"Widgets &<br />Sprockets", // Embedded HTML
DisplayText:"President's Address",
DisplayText:"<img src='m1.gif' width='80' height='20' alt='M. 1' />",
// Note: ALWAYS include height/width in
// embedded image declarations!
DisplayText:prd+" Menu",
// concatenate the user defined variable
// prd to Menu.
// Incorrect:
DisplayText:Products, // strings must be quoted
DisplayText:'prd+" Menu"',
// no quoted expressions
- Default:
- null
- See Also:
-
TextAlign,
Using Classes Mini Tutorial
|