Hiermenus Go Forth, XII - DHTML Lab | 2 | WebReference

Hiermenus Go Forth, XII - DHTML Lab | 2


Hiermenus Go Forth, XII:
Version 4.0.5 - The Complete Script (Full-Window)

Problems reported with 4.0.3 and fixed in 4.0.4

  1. In IE4 for Windows and IE5 for Macintosh, additional white space appeared between menu items.

    The menus on the left illustrate the problem. Menu items with more-than-one-word, that is menu items with a space character, are problematic. It is as if IE wrapped the text, positioned the item below, then re-rendered the text correctly within the item, leaving the sibling item below stranded in the wrong position. This problem was dependent on page complexity, computer speed, and many other factors. It is not always reproducable.

    This problem did not exist in Version 3 because our items were not positioned elements in IE. The versatility of Version 4 (horizontal/vertical menus, etc.) warrants positioned elements. The menu items are positioned next-to or under previous items, depending on the item size. IE is miscalculating the size. This miscalculation is based on an old IE problem related to its element-property value updating. Property values are not updated immediately, or at least not fast enough for JavaScript. We won't go into detail here, but we have been trying to work around this problem since the Jigsaw Puzzle script years ago. The only solution is to wait for IE to catch up. Therefore, in Version 4.0.5, items are positioned, and menus sized, only when they are to be made visible for the first time, not when they are created. This ensures that IE has time to update the property values we need for our positioning routines.
    Thanks to Brett Death

  2. In IE, mousing over an image inside a menu item did not cause child menus to appear. The user had to mouse over an empty part of the menu item (or text on the menu item).

    This behavior was by design and solved a flicker problem when a user moused over the "more" image. All images were excluded from the mouseover event (the IE event model assigns the item-mouseover to all contained elements as well) to avoid multiple highlight changes causing the flicker. In Version 4.0.5, only the "more" image is affected, not all images as before.
    Thanks to Javier Morales

  3. In NS4, the tree UponDisplay and UponHide parameters were called in reverse. This was caused by the following line in HM_f_ShowIt():

        if (on != this.hidden)

    It has been corrected to read:

        if (on == this.hidden)


In NS4, the menu-creation speed depends not on the number of layers created (time is negligible), but on the number of layers written-to with text content. All HTML that is placed in a layer with document.write is first written to a text file in the browser's cache. This is what can slow down menu-creation in NS4.

A separate layer is created that displays when an item is highlighted. This is necessary since font color cannot be dynamically changed in NS4, only background color. We can significantly improve menu-creation speed by omitting this extra layer. In Version 4.0.5, this layer is omitted:

  1. automatically by the script, when the mouseover font color is the same as the idle-state font color. In this case, the script knows that an extra layer is redundant and does not create it.

  2. by using the new HM_NSFontOver parameter. If HM_NSFontOver is true, an extra layer is created unless the mouseover font color is the same as the idle-state font color. If HM_NSFontOver is false, the extra layer is never created, but NS4 users will not get a different mouseover font color if one is called for. Item highlight is achieved by background color change only. This may be a small price to pay for the improved menu-creation speed.

Outstanding Issues

The major outstanding issue involves the correct evaluation of JS statements used in the declaration of parameters. The page-specific and global parameters accept most JS expressions. Some expressions, especially those involving foreign characters or font names are still problematic. We will attempt to include the new algorithm we are working on in the next release.

Again, if you don't know what we're talking about, it means you are not having problems, which is a good thing.

On the next page, the sample page included in the download.

Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: Mar 12, 2001
Revised: Mar 12, 2001

URL: http://www.webreference.com/dhtml/column48/2.html