Hiermenus Go Forth, XXVIII - DHTML Lab | 5 | WebReference

Hiermenus Go Forth, XXVIII - DHTML Lab | 5


Logo

Hiermenus Go Forth, XXVIII:
Version 4.2.2 - The Complete Script (Full-Window)



IE5 for Macintosh Fix

HM 4.2.1 introduced support for the new tall-menu scrolling behavior in IE5Mac. In our discussion, we mentioned the update problems and our solution. We size and position to-be-displayed child menus, then display them with a timer. We overlooked that all parent menu properties that reflected the child menu's display status should not be updated before the timer fires. Properties like menuElement.hasChildVisible and menuElement.visibleChild should be set after the timer fires, not before.

Even though the display time interval is negligibly short, a user moving their mouse at light speed over the menu items (like one Dan Ragle seems to do from time to time) can create orphan child menus. That is, child menus that the script believes do not exist because the necessary properties that reflect their status have incorrect values. And since HM believes these child menus to be hidden, it never hides them, even when the top-level menu is hidden.

We have corrected this by creating a new function HM_f_DisplayChild() that is called as the displayChild() method of menu items:

Version 4.2.1

function HM_f_ShowChild(){
    ...        
    this.child.moveTo(this.child.xPos,this.child.yPos);
    this.menu.hasChildVisible = true;
    this.menu.visibleChild = this.child;
    if(HM_IE5M) {
        setTimeout(this.child.id+".showIt(true)",10);
    }
    else {
        this.child.showIt(true);
    }
}

Version 4.2.2

function HM_f_ShowChild(){
    ...        
    this.child.moveTo(this.child.xPos,this.child.yPos);
    if(HM_IE5M) {
        setTimeout(this.id+".displayChild()",10);
    }
    else {
        this.displayChild();
    }
}
function HM_f_DisplayChild(){
    this.menu.hasChildVisible = true;
    this.menu.visibleChild = this.child;
    this.child.showIt(true);
}

Oops!

Version 4.2.1 had a regression bug because of a couple of lines inadvertantly omitted from HM_f_ShowChild() in HM_ScriptDOM.js:

function HM_f_ShowChild(){
    ...        
    if(!this.tree.PositionUnder || this.menu!=this.tree.treeParent) {
        if(this.child.scrollbarsCreated) {                    <--
            this.child.style.height = this.child.origHeight;  <--  omitted by mistake
        }                                                     <--
        this.child.keepInWindow();
    }
}

This omission could cause scrollbars to display permanently on short menus that displayed menus after browser resize.

Files Changed in Version 4.2.2

You will need to overwrite previous versions of the above files to upgrade to 4.2.2.

If you set the new global parameter HM_GL_ScrollBothBars, then you will need to add it to your version of HM_Loader.js.

On the next page, a sample demonstration page.


Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: March 07, 2002
Revised: March 07, 2002

URL: https://www.webreference.com/dhtml/column64/4.html