spacer

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

home / experts / dhtml / column21 / addendum9
Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Logo

Hierarchical Menus Ver. 3 - Addendum IX (v3.09)
enabling menus for IE5 Macintosh


An item element's styling depends on styles applied to all menus (via the in-page parameters) or menu-tree-specific styles defined in the arrays. These style values are made properties of the menu element in our setMenuTree() function. Every item then grabs these values from its containing menu and uses them.

Therefore, every item must be able to identify its containing menu correctly. This identification is achieved with the following statement in our itemSetup() function:

function itemSetup(whichItem,whichArray) {
    ...
    this.container = (NS4) ? this.parentLayer : this.offsetParent;
    ...
}

IE5Mac doesn't like the offsetParent property, and possibly rightly so, since the menu items are not positioned elements but simple SPANs, that are not directly offset from their parent, but placed in the regular HTML flow. It may not like it because the offsetParent property has yet to be updated. Whatever the case, it does like the parentElement property.

Although they are two completely different properties, for our purposes offsetParent and parentElement are interchangeable. We therefore appease IE5Mac with the following change:

function itemSetup(whichItem,whichArray) {
    ...
    this.container = (NS4) ? this.parentLayer : this.parentElement;
    ...
}

Now, try the menus:

Menu Example 1:

Menu Example 2:

 
Menu 1
Menu 2

Well, it's happening, but the horizontal size on the first menu is off. What to do?


Produced by Peter Belesis and

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

All Rights Reserved. Legal Notices.
Created: June 16, 2000
Revised: June 16, 2000

URL: http://www.webreference.com/dhtml/column21/addendum9/4.html