Hiermenus Go Forth, II - DHTML Lab | 3 | WebReference

Hiermenus Go Forth, II - DHTML Lab | 3

Logo

Hiermenus Go Forth, II:
Version 4 - The External Arrays - New Menu Tree Parameters



Element 9 - top_is_permanent

Description
Defines whether the top-level menu in a menu tree is permanently visible.


The menu on the left is permanently positioned and visible on this page. It is the top-level menu in a menu tree, meaning that all child menus in the cascade will appear off of it.


The in-page text links on the left are also a top-level menu. There are no child menus and no cascade. Rollover the text with your mouse. By omitting border, separator and initial color values, we have created a text-link rollover using the HM script!

Value
Boolean
May be specified as:
  • true Boolean (true / false)
  • integer Boolean (1 / 0)
  • string JS expression to be evaluated

Example Values
true Boolean: true
    The top-level menu will always be visible, creating an in-page permanent rollover.
true Boolean: false
    The top-level menu is not permanently visible, and appears only when the user mouses over or clicks on a link. In other words, it assumes the behavior of the previous versions of HM.

integer Boolean: 1
    The top-level menu will always be visible, creating an in-page permanent rollover.
integer Boolean: 0
    The top-level menu is not permanently visible, and appears only when the user mouses over or clicks on a link. In other words, it assumes the behavior of the previous versions of HM.

JS expression (function call): "setPermanence()"
    A custom function that you have created is called. The return value of this function will be assigned to the top_is_permanent parameter.
JS expression (complete statement): "(IE4)"
    The top-level menu will be permanently visible only if the user's browser is Internet Explorer. If you have browser-specific pages on your site, you can create two different menus, one for each browser, then choose which one to display permanently. This way, the user sees only the relevant menu items.
    A separate, companion, menu array for our example would have the value set in the next example.
JS expression (complete statement): "(NS4)"
    This top-level menu will be permanently visible only if Netscape Navigator is being used.

Default
false.
If parameter is omitted, the top-level menu is NOT permananetly visible and assumes pop-up behavior.

Differences from Version 3 equivalent
There is no Version 3 equivalent. Top-level menus always appeared after user mouse events.

Comments
This is possibly the most powerful of the new top-level menu features.
It changes the HM script from a pop-up cascading menu script to a general-purpose in-page rollover script!

Important Note #1:
The HM script creates elements dynamically for DHTML-enabled browsers. If you choose to have a permanently-visible top-level menu array, keep in mind that it will only appear in IE4+ and NS4+. This is fine if your users all have DHTML browsers, as might be the case in a controlled intranet environment. On the Web, this parameter should be true only if you have different pages for old browsers, or you include some alternative type of navigation for old browsers.

Important Note #2:
You should use permanently-visible menus only if:

  1. Your complete page is DHTML-based. That is, you have formatted your page with positioned elements and not tables. If all your elements are positioned, you should have no problem placing a permanent menu amongst them.
  2. Your page is not DHTML-based but you make space allowances for permanent menus. In a table-based layout, for example, you can insert a placeholder image, the size of the menu, and then position the menu on top of the static image. This image may be transparent (as I have done on this page) or may include alternate navigation for old browsers.

Important Note #3:
This parameter should always be used in conjuction with the left_position and top_position parameters (see previous column), as a permanently visible menu needs absolute position coordinates.


The next parameter-element addresses a common request: horizontal menu layout.


Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: Sept 05, 2000
Revised: Sept 05, 2000

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