spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / dhtml / column18
Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Hierarchical Menus in Frames
menu hiding

All the functions associated with hiding the menus, either in full or just child menus, do not change for the frames version of the script. They are discussed in the first hierarchical menu column and are simply reproduced here for reference.

function popDown(menuName){ 
  if (!areCreated) return;
  whichEl = eval(menuName);
  whichEl.isOn = false;
  whichEl.hideTop();
}

function hideAll() {
  for(i=1; i<topCount; i++) {
    temp = eval("elMenu" + i);
    temp.isOn = false;
    if (temp.hasChildVisible) temp.hideChildren();
    temp.showIt(false);
  }  
}
    
function hideTree() { 
  allTimer = null;
  if (isOverMenu) return;
  if (this.hasChildVisible) {
    this.hideChildren();
  }
  this.hideParents();
}

function hideChildren(item) {
  if (this.visibleChild.hasChildVisible) {
    this.visibleChild.visibleChild.showIt(false);
    this.visibleChild.hasChildVisible = false;
  }

  if (!this.isOn || !item.hasMore
      || this.visibleChild != this.child) {
    this.visibleChild.showIt(false);
    this.hasChildVisible = false;
  }
}

function hideParents() {     

  if (this.hasParent) {
    this.showIt(false);
    if (this.parentMenu.hasParent) {
      this.parentMenu.isOn = false;    
      this.parentMenu.showIt(false);
      this.parentMenu.parentMenu.isOn = false;
      whichEl = this.parentMenu.parentMenu
    }
    else {
      this.parentMenu.isOn = false;
      whichEl = this.parentMenu;
    }
  }
  else {
    whichEl = this;
  }

  whichEl.hideTop();
}

function hideTop() {
  whichEl = this;
this.hideTimer=setTimeout("whichEl.hideSelf()",mSecsVis);
}

function hideSelf() {
  this.hideTimer = null;
  if (!this.isOn && !isOverMenu) { 
    this.showIt(false);
  }
}

That wraps it up for the script. The final part of our technique involves ensuring that after the frameset has been established, all new pages that load into the main frame generate menus.


Produced by Peter Belesis and

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint

All Rights Reserved. Legal Notices.
Created: Apr. 08, 1998
Revised: Apr. 08, 1998

URL: http://www.webreference.com/dhtml/column18/menuFrHide.html