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

Hiermenus Go Forth, I - DHTML Lab | 5

Logo

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



Another Important Note
This column contains many in-page illustrations. These are not created by the HM script. The code will be made public as it is discussed. For now, we provide hard-coded illustrations only.

Introduction

The Version 4 menu arrays are different in name, declaration and structure than their Version 3- counterparts.

If you are familiar with the Version 3- arrays, the modifications will be easy to follow.

Here, in tabular format are the differences between the old and new arrays. Give them the once over, then we'll discuss them:

ChangeVersion 3Version 4
Name arMenu1 = ...
arMenu1_1 = ...
HM_Array1 = ...
HM_Array1_1 = 
Declaration arMenu1 = new Array(
...
)
HM_Array1 = [
...
]
Top-Level-Menu Tree-Specific Parameters arMenu1 = new Array(
width,
left_position, top_position,
font_color, mouseover_font_color,
background_color, mouseover_background_color,
border_color, separator_color,
...
)
HM_Array1 = [
[width,
left_position, top_position,
font_color, mouseover_font_color,
background_color, mouseover_background_color,
border_color, separator_color,
top_is_permanent,
top_is_horizontal, tree_is_horizontal,
position_under,
top_more_images_visible, tree_more_images_visible,
evaluate_upon_tree_show, evaluate_upon_tree_hide]
,
...
]
Child-Menu Menu-Specific Parameters n/a HM_Array1_1 = [
[],
...
]
Item-Defining Elements arMenu1 = new Array(
...
item_display_text, item_link_url, item_has_child,
item_display_text, item_link_url, item_has_child,
...
)
HM_Array1_1 = [
...,
[item_display_text,item_link_url, item_is_rollover, item_permanently_highlighted, item_has_child],
[item_display_text,item_link_url, item_is_rollover, item_permanently_highlighted, item_has_child],
...
]

Thus, using real-world syntax, the old and new arrays would look like this:

TypeVersion 3Version 4
Top-Level Menu Array arMenu1 = new Array(
150,
220,310,
"black","green",
"#2D9B83","#4BB9A1",
"black","black",
"Experts", "http://www.webref.com/experts/",1,
"Contents", "http://www.webref.com/index2.html",0
)
HM_Array1 = [
[
150,
220,310,
"black","green",
"#2D9B83","#4BB9A1",
"black","black",
true,
1,0,
true,
true,1,
"hideForms()","showForms()"]
[
"Experts", "http://www.webref.com/experts/", 1,0,1],
["Contents", "http://www.webref.com/index2.html", 0,0,0]
]
Child Menu Array arMenu1_1 = new Array(
"3-D","http://www.webref.com/3d/",0,
"Design","http://www.webref.com/dlab/",0,
"DHTML","http://www.webref.com/dhtml/",1,
"JavaScript","http://www.webref.com/js/",0
)
HM_Array1_1 = [
[]
,
["3-D", "http://www.webref.com/3d/",1,0,0],
["Design", "http://www.webref.com/dlab/",1,0,0],
["DHTML", "http://www.webref.com/dhtml/",1,0,1],
["JavaScript", "http://www.webref.com/js/",1,0,0]
]

Yet Another Important Note
Don't Panic!. Yes, the arrays have quite a few differences. But, you are not expected to convert your old arrays by hand. The final page of this column hosts a cut-and-paste dynamic tool to convert your entire Version 3 array file to the Version 4 standard with a few mouse clicks.

We'll now move on to discuss the changes in detail, pausing first for a short recap of what the arrays are actually meant to do.


Produced by Peter Belesis and

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

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