Hiermenus Go Forth, VI - DHTML Lab | 9 | WebReference

Hiermenus Go Forth, VI - DHTML Lab | 9

Logo

Hiermenus Go Forth, VI:
Version 4 - The Page-Specific Parameters (cont'd)



HM_PG_ChildPerCentOver

Description
Sets the horizontal distance a child menu overlaps its parent menu, as a percentage of the parent menu's width. That is, if the parent menu is 120 pixels wide and HM_PG_ChildPerCentOver is given a value of 25, then the child overlap will be 25% of 120, which is 30. All menu trees in the page are affected.

HM_PG_ChildPerCentOver overrides HM_PG_ChildOverlap parameter and the site-wide global settings declared in the external script.

Value
Percent.
May be specified as:
  • integer
  • string
  • string JS expression to be evaluated

Example Values
integer: 30
    All child menus will overlap their parent menus by thirty percent of the parent menu width.

string: "20"
    All child menus will overlap their parent menus by twenty percent of the parent menu width.

JS expression: "getChildPerCentOver()"
    A custom function that you have created will be called. The return value of this function will be the HM_PG_ChildPerCentOver parameter, and all menus in the page will comply.

JS expression: "(IE4) ? ((document.body.clientWidth>800) ? 20 : 40) : ((window.innerWidth>800) ? 20 : 40)"
    The complete JS code is included in the parameter declaration. In the above example, HM_PG_ChildPerCentOver will be 20 if the browser window is more than 800 pixels wide, and 40 if it is not.

Default
If this parameter is omitted, the HM_PG_ChildOverlap parameter is used. If HM_PG_ChildOverlap is omitted, then the relevant Global Parameter value set in the external script is used.

Differences from Version 3 equivalent
The perCentOver parameter in Version 3:
  • was mandatory.
  • did not accept JS expression values.

Comments
If you do not want your child menus to overlap the parent menu, give HM_PG_ChildPerCentOver a value of 0.

To leave space between your child menus and their parents, give HM_PG_ChildPerCentOver a negative value (ex: HM_PG_ChildPerCentOver = -20. This would place your child menu away from the parent at a pixel distance of 20% of the parent's width.)

Next, HM_PG_ChildOffset.


Produced by Peter Belesis and

All Rights Reserved. Legal Notices.
Created: Dec 12, 2000
Revised: Dec 12, 2000

URL: https://www.webreference.com/dhtml/column42/6.html