Hiermenus Go Forth, XVIII - DHTML Lab | 4 | WebReference

Hiermenus Go Forth, XVIII - DHTML Lab | 4


Hiermenus Go Forth, XVIII:
Version 4.0.11 - The Complete Script (Full-Window)

Tree-level ClickStart

As we know, the appearance of a top-level menu can be either by user click or user mouseover of an in-page link. This popup event is specified by the HM_GL_ClickStart and/or HM_PG_ClickStart parameters. All menu trees on a page displayed upon the same user event, either mouseover or click.

Starting with Version 4.0.11, the top-level menu display event can be specified on a menu-tree level. All menu trees on a page inherit the HM_PG_ClickStart event, which can now be overridden by the new display_on_click array parameter:

HM_Array2 = [
[100,      // menu width
50,        // left_position
50,        // top_position
"red",     // font_color
"yellow",  // mouseover_font_color
"yellow",  // background_color
"black",   // mouseover_background_color
"blue",    // border_color
"green",   // separator_color
1,         // top_is_permanent
1,         // top_is_horizontal
1,         // tree_is_horizontal
0,         // position_under
0,         // top_more_images_visible
1,         // tree_more_images_visible
"null",    // evaluate_upon_tree_show
"null",    // evaluate_upon_tree_hide
false,     // right-to-left
true],     // display_on_click

This is an optional parameter, and should be set only if the tree should appear on an event different from the default. If set to true, the menu tree will appear when the user clicks on the in-page link. If set to false, the menu tree will appear upon user mouseover. Integer booleans and JS expressions can also be used to define the parameter.

Permanent Top-Level Menu Tree Cascade-on-Click

The permanent top-level menus introduced in Version 4 are taking the place of in-page links on many Web sites. The HM_GL_ClickStart and/or HM_PG_ClickStart parameters caused the top-level menu to appear upon a user event. They did not account for a permanent top-level menu, where the user would intuitively expect the event to apply to the second menu level.

For example, if you set HM_PG_ClickStart to true, all menus on a page would appear when the user clicked on an in-page link. But a second-level child menu would still only appear upon mouseover of a permanent top-level menu. Since the top-level menu is in-the-page, the second-level child should appear upon user click.

Version 4.0.11 corrects this behavior quirk. The menu-displaying event, set in HM_GL_ClickStart and/or HM_PG_ClickStart and/or display_on_click is applied to the top-level menu if it is not permanent and to the second-level menu if the top-level menu is permanent.

The Version 4.0.11 download demonstrates the new behavior.

Note: If you specify a click event for a permanent menu, the menu items that have an associated child menu will only cause a child menu to appear upon click. Any link URLs specified for these items are ignored.

The improvements on this page have come as a result of a real-world use of HM by Chris Dart.

On the next page, final minor improvements.

Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: May 30, 2001
Revised: May 30, 2001

URL: http://www.webreference.com/dhtml/column54/3.html