spacer

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

home / experts / dhtml / column35
Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

Logo

Hiermenus Go Forth, I:
Version 4 - The External Arrays



The Top-Level Menu Array

The first element in every top-level menu array (HM_Array1, HM_Array2, etc.) is an array containing parameters that affect the complete menu tree, that is, the top-level menu being defined and all child menus that may appear in its cascade. We will refer to the parameters in this array as the Tree-Specific Overhead Parameters

The Tree-Specific Overhead Parameters

There are seventeen Tree-Specific Overhead Parameters. Providing values for any of these is OPTIONAL. If you provide no value, a null value or an empty string ("") value, there are no adverse effects. Default values for the parameters exist elsewhere and will kick in. These default values may be in the in-page parameters, to be discussed next column, or in the main external script.

We will not discuss setting the default values in this column, since we are dealing only with the arrays.

The Tree-Specific Overhead Parameters are defined in this order:

HM_Array1 = [
   [
   0 width,
   1 left_position,
   2 top_position,
   3 font_color,
   4 mouseover_font_color,
   5 background_color,
   6 mouseover_background_color,
   7 border_color,
   8 separator_color
   9 top_is_permanent,
  10 top_is_horizontal,
  11 tree_is_horizontal,
  12 position_under,
  13 top_more_images_visible,
  14 tree_more_images_visible,
  15 evaluate_upon_tree_show,
  16 evaluate_upon_tree_hide
   ]
...
]

Element 0 - width

Description
Sets the menu width for the menu tree. All menus in the cascade (top-level and children) are affected.

Value
Pixels.
May be specified as:
Example Values
integer: 150

string: "150"

JS expression: "getWidth()"
JS expression: "(IE4) ? ((document.body.clientWidth<800) ? 150 : 200) : ((window.innerWidth<800) ? 150 : 200)"

Default
Set by author using the In-Page Parameters.

Differences from Version 3 equivalent
Version 3 accepted only integer values.

Notice that we are introducing multiple value-types for our parameters. A common error in using Version 3 was to include strings where integers were called for and vice-versa. Version 4 will accept either when a number is called for, and in many cases (like the above) will even accept a JS expression. The use of function calls and in-line JS statements gives you the ability to easily provide conditional values and to expand the script functionality.

So, let's look at the next parameter-elements.


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 >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji

All Rights Reserved. Legal Notices.
Created: Aug 08, 2000
Revised: Aug 08, 2000

URL: http://www.webreference.com/dhtml/column35/7.html