spacer

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

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

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, 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: June 16, 2000
Revised: June 16, 2000

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