DHTML Menu Builder Variables


Note: In HTML Editor version 2009 and higher, the DHTML Menu Builder has been replaced with the CSS Menu Designer. To upgrade to the latest version of the HTML Editor, download it from your My Products page. For more information about the CSS Menu Designer, read How to Use the CSS Menu Designer.

This article explains the different variables available in the DHTML Menu Builder:

NoOffFirstLineMenus
Number: The number of elements in the first row or column of your menu.

LowBgColor
Text string: The background color of the element when the mouse is not positioned over it. Can be a supported color name like "red" or "blue," or an RGB string such as #ff552z. Can be overruled by the variable in the menu tree.

HighBgColor
Text string: Background color of the element when the mouse is positioned over it. Can be a supported color name like "red" or "blue," or an RGB string such as #ff552z. Can be overruled by the variable in the menu tree.

FontLowColor
Text string: Font color when the mouse is not positioned over the element. Can be a supported color name like "red" or "blue," or an RGB string such as #ff552z. Can be overruled by the variable in the menu tree.

FontHighColor
Text string: Font color when the mouse is positioned over the element. Can be a supported color name like "red" or "blue," or an RGB string such as #ff552z. Can be overruled by the variable in the menu tree.

BorderColor
Text string: Border color. Can be a supported color name like "red" or "blue," or an RGB string such as #ff552z. Can be overruled by the variable in the menu tree.

BorderWidth
Number: Thickness (in pixels) of the border around the element.

BorderBtwnElmnts
Number 1 or 0: Determines whether a border appears between the elements. Select 1 for a border or 0 for no border.

FontFamily
Text string: More than one font can be declared by separating the different names with a comma (e.g. arial, times new roman, ms comic sans). The browser will use the first font found on the user's system.

FontSize
Number: The point size of the font (e.g. 10pt, 12pt, etc.).

FontBold
Number 1 or 0: 1 makes the font weight bold; 0 makes the font weight normal.

FontItalic
Number 1 or 0: 1 makes the font italic; 0 makes the font normal.

MenuTextCentered
Text string: Can be 'left', 'center', or 'right'.

MenuCentered
Text string: Can be 'left', 'center', 'right', 'justify' or ''. StartLeft is added to the calculated position. '' is the same as 'left'.

MenuVerticalCentered
Text string: Can be 'top', 'middle', 'bottom' or ''. StartTop is added to the calculated position. '' is the same as 'top'.

ChildOverlap
Number between 0 and 1: Controls the horizontal offset of a sublevel from its parent level. With a value of .25, the submenu will appear 25% to the right of the left-hand side of the root menu. Negative values place the submenu to the left of the root.

ChildVerticalOverlap
Number between 0 and 1: Controls the vertical offset of a sublevel from its parent level. With a value of .25, the submenu will appear 25% lower than the top of the root menu. Negative values place the submenu higher than the top of the root.

LeftPadding
Number: Defines the distance between the left side of the menu text and the border of the element.

TopPadding
Number: Defines the distance between the top side of the menu text and the border of the element.

StartTop
Number: Defines the vertical position of the menu in the document. This is ignored when MenuVerticalCentered is 1 or when the menu is positioned across frames and the frames are orientated in rows. In the latter case, the menu is placed at the bottom of the frame FirstLineFrame.

StartLeft
Number: Defines the horizontal position of the menu in the document. This is ignored when MenuCentered is 1 or when the menu is positioned across frames and the frames are orientated in columns. In the latter case, the menu is placed at the far right in the frame FirstLineFrame.

VerCorrect
Number: Defines the vertical correction of the second line of the menu in the document. This can come in handy when using nested frames.

HorCorrect
Number: Defines the horizontal correction of the second line of the menu in the document. This can come in handy when using nested frames.

FirstLineHorizontal
Number 1 or 0: When set to 1, the elements of the first level are horizontally arranged next to each other. When set to 0, these elements are vertically arranged below each other.

MenuFramesVertical
Number 1 or 0: Set this variable to 1 when your frameset is laid out in columns. Set it to 0 when your frameset is laid out in rows. If the menu is contained in a single frame, or if you are not using frames, the number is irrelevant but still must be provided.

DissapearDelay
Number: The time in milliseconds that the menu's sublevels stay visible after the mouse is no longer positioned over the menu.

TakeOverBgColor
Number 1 or 0: When set to 1, the background color of the frame where the root menu is located will change to the same background color of the frame where the sublevels are located. If the menu is contained in a single frame, or if you are not using frames, the number is irrelevant but still must be provided.

FirstLineFrame
Text string: When the menus are used in a frameset, this is the name of the frame where the root menu is located. If the menu is located in a single page, set this variable to 'self'.

SecLineFrame
Text string: When the menus are used in a frameset, this is the name of the frame where the sublevels of your menu are located. SecLineFrame may be equal to FirstLineFrame. When the menu is located in a single page, set this variable to 'self'.

DocTargetFrame
Text string: When the menus are used in a frameset, this is the name of the frame where the documents are loaded. Normally, this will be equal to SecLineFrame. When the menu is located in a single page, set this variable to 'self'.

HideTop
Number 1 or 0: Only relevant when the menu is used in a frameset. When set to 1, the top-level items remain hidden while a new document is loaded in the target frame until the menu is built again.

MenuWrap
Number 1 or 0: When set to 1, unfolding items are wrapped when the menu doesn't fit on the window.

RightToLeft
Number 1 or 0: When set to 1 the menu unfolds from left to right.

TargetLoc
Text string: Enables relative positioning of the menu.
1. Place a named div in the HTML file where the menu is displayed:

<div id='MenuPos' style='position:relative'></div>

2. Set TargetLoc to 'MenuPos'.
3. Set MenuCentered to 'left', MenuVerticalCentered to 'top' and StartTop and StartLeft to 0.
4. StartTop, StartLeft and the Menu center variables can still be used to get an offset from the <div>.

Note: This feature can be difficult to use because of the different ways browsers interpret the pageX and pageY offset. The best results can be achieved by putting the div inside a table, giving the div the same dimensions as the first level of the menu, and putting a transparent image inside the div with the same dimensions as the first level of the menu.

<table>   <tr><td>     <div id='MenuPos' style='position:relative; width:102; height:102;'><img src='transparent.gif' width='102' height='102'></div>   </td></tr> </table>

UnfoldsOnClick: Number 1 or 0: When set to 1, the menu unfolds when clicked. When set to 0, the menu unfolds on mouseover.

WebMasterCheck
Number 1 or 0: When set to 1, the script performs a check on the frame names and the menu tree. When your menu is running, this should be set to 0.

ShowArrow
Number 1 or 0: When set to 1, the arrow .gifs are displayed.

KeepHilite Number 1 or 0: When set to 1, the selected path stays highlighted.

Arrws
Array: Describes the three images used as arrows. The format should be: source, width, height.

BeforeStart
Function: Called just before the menu is built. By default, this variable is left empty.

AfterBuild
Function: Called just after the menu is built. By default, this variable is left empty.

BeforeFirstOpen
Function: Called when the mouse hovers over a main menu item that has a submenu. By default, this variable is left empty.

AfterCloseAll
Function: Called when the mouse leaves the menu. By default, this variable is left empty.

TextToShow
Text string: The text, image, or HTML you want to display in the element. To use an image, format the HTML like this:

<img src='MyImage'>

To use rollover images, use this code:

rollover:MyImage1:MyImage2

To leave this field blank, use "".

Link
Text string: Where you want to go when you click the element. This can also be used to execute JavaScript statements. For instance, when you want the link to open in the top window, use this:

"javascript:top.document.location.href='Link.htm';"

You can also start a whole new script when the element is clicked with the help of JavaScript:

"javascript:{your script; another function;}"

BgImage
Text string: Background image for the element. Not supported for NS4 when the menu is located across frames.

NoOfSubs
Number: The number of subelements of this element in the next level.

Height
Number: The height in pixels of the element. Any element with a name ending in 1 (e.g. Menu1, Menu5_3_1) must have a number in place for this variable. All other elements may set this variable to 0. Elements in a vertical column may have different heights, but all elements in a horizontal row get the height of the first element in that row.

Width
Number: The width in pixels of the element. Any element with a name ending in 1 (e.g. Menu1, Menu5_3_1) must have a number in place for this variable. All other elements may set this variable to 0. Elements in a horizontal row may have different widths, but all elements in a vertical column get the width of the first element in that column.

BgColor
Text string: Background color of the element when the mouse is not positioned over it. When used, this variable overrules the global variable LowBgColor. When not used, it must be set to "". It can be a supported color name like red or blue, or an RGB string like #ff552a.

BgHiColor
Text string: Background color of the element when the mouse is positioned over it. When used, this variable overrules the global variable HighBgColor. When not used, it must be set to "". It can be a supported color name like red or blue, or an RGB value like #ff552a.

FontColor
Text string: Font color of the element when the mouse is not positioned over it. When used, this variable overrules the global variable LowFontColor. When not used, it must be set to "". It can be a supported color name like red or blue, or an RGB value like #ff552a.

FontHiColor
Text string: Font color of the element when the mouse is positioned over it. When used, this variable overrules the global variable HighFontColor. When not used, it must be set to "". It can be a supported color name like red or blue, or an RGB value like #ff552a.

BorderColor
Text string: Border color of the group of elements. Only the color of elements with names ending in 1 are used. When used, this variable overrules the global variable BorderColor. When not used, it must be set to "". It can be a supported color name like red or blue, or an RGB value like #ff552a.

Rate This Article

You must be signed in to rate articles.