DHTML Menu Builder Variables
The variables
- NoOffFirstLineMenus
- number- The number of elements in the first row or colom of your menu.
- LowBgColor
- Text string- Background color of the elements when the mouse is not over the element.
Can be a supported color name like red or blue or a RGB string like #ff552a.
Can be over ruled by the variable in the menu tree
- HighBgColor
- Text string- Background color of the elements when the mouse is over the element.
Can be a supported color name like red or blue or a RGB string like #ff552a.
Can be over ruled by the variable in the menu tree
- FontLowColor
- Text string- Font color when the mouse is not over the element.
Can be a supported color name like red or blue or a RGB string like #ff552a.
Can be over ruled by the variable in the menu tree
- FontHighColor
- Text string- Font color when the mouse is over the element.
Can be a supported color name like red or blue or a RGB string like #ff552a.
Can be over ruled by the variable in the menu tree
- BorderColor
- Text string- Border color.
Can be a supported color name like red or blue or a RGB string like #ff552a.
Can be over ruled by the variable in the menu tree
- BorderWidth
- Number- Thickness of the border around the elements in pixels.
- BorderBtwnElmnts
- Number 1 or 0- Controls if there is a border between the elements. 0 is no border between the elements.
- FontFamily
- Text string- More than one font can be declared seperated with a comma.
Example: arial, times new roman, ms comic sans. The browser will use the first font found on the users system.
- FontSize
- Number- Size of the font in pt.
- 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 what part of a level is covered with it's sublevel.
With a value of .25 a level will covered be for 25% by it's sublevel. Negative values are possible, but not very usefull.
- ChildVerticalOverlap
- Number between 0 and 1- Controls the vertical offset of a sublevel from it's parent level.
With a value of .25 a sublevel will start 25% of the parents level height lower. Negative values will make the start higher. - 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.
Is ignored whenMenuVerticalCentered is 1. Is also ignored when the menu is across frames and the frames are orientated in rows. The menu is in that case placed at the bottom of the frame FirstLineFrame.
- StartLeft
- Number- Defines the horizontal position of the menu in the document.
Is ignored whenMenuCentered is 1. Is also ignored when the menu is across frames and the frames are orientated in coloms. The menu is in that case placed at the far right position the frame FirstLineFrame.
- VerCorrect
- Number- Defines the vertical correction of the seconde line of the menu in the document.
Can be usefull in situations with nested frames
- HorCorrect
- Number- Defines the horizontal correction of the second line of the menu in the document.
Can be usefull in situations with nested frames
- FirstLineHorizontal
- Number 1 or 0- When set to 1 the elements of the first level are placed horizontal next to each other.
When set to 0 these elements are placed vertical below each other.
- MenuFramesVertical
- Number 1 or 0- Set this variable to 1 when your frameset is laid out in coloms.
set to 0 when your frameset is in rows. Irrelevant when the menu is on a single page or frame, but must be 0 or1
- DissapearDelay
- Number- The time in milliseconds the menu's sublevels stay visible after the mouse is no longer over the menu.
- TakeOverBgColor
- Number 1 or 0- When set to 1 the background color of the frame where the menu's first line is in will become the same as the frame where the sublevels are in.
Irrelevant when the menu is on a single page or frame, but must be 0 or1
- FirstLineFrame
- Text string- When the menus are used in a frameset this is the name of the frame where the first line of your menu is located.
When the menu is used in a single page, this must be 'self'
- SecLineFrame
- Text string- When the menus are used in a frameset this is the name of the frame where the sub levels of your menu are located.
It is allowed to have SecLineFrame equal to FirstLineFrame
When the menu is used in a single page, this must be '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 used in a single page, this must be 'self'
- HideTop
- Number 1 or 0- Only relevant when the menu is used in a frameset. When set to 1 the top level items are hidden when a new document is loaded into 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- In the HTML-file where the menu shows you need a named div:
<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>.
Remarks: the different ways browsers interpret the pageX and pageY offset makes this feature difficult. I got the best results by putting the div inside a table, give the div the same dimensions as the first level menu, put an transparent image inside the div with again the same dimensions as the first level 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 onclick, when set to 0 the menu unfolds on mouse over.
- 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 show.
- KeepHilite
- Number 1 or 0- When set to 1 the selected path stays highligthed.
- Arrws
- array- Describes the three images used as arrows.
Format: source, width, height
- BeforeStart
- function- Is called just before the menu is build. Is by default empty. Can be used by user.
- AfterBuild
- function- Is called just after the menu is build. Is by default empty. Can be used by user.
- BeforeFirstOpen
- function- Is called when the mouse enters a main menu item that has children. Is by default empty. Can be used by user.
- AfterCloseAll
- function- Is called when the mouse leaves the menu. Is by default empty. Can be used by user.
- TextToShow
- Text string- What you want to show in the element. It can be text, an image or html
To show an image it must look like "<img src='MyImage'>"
To use roll over images use "rollover:MyImage1:MyImage2"
To leave this field blank use ""
- Link
- Text string- Where you want to go when you click the element.
Looks like "MyLink"
Can also be used to execute javascript statements. For instance when you want the link to open in the top window use "javascript:top.document.location.href='Link.htm';"
You can in fact start a whole script when the element is clicked with the help of javascript:. "javascript:{your script; another function;}"
- BgImage
- Text string- background image for the element. Is not supported for NS4 when the menu is across frames.
I had to disable this for NS4 in frame setup because I could not get it to work properly. (Everybody who wants to try and find a solution for this is very welcom. Enable in menu_com.js)
- NoOfSubs
- Number- The number of sub elements of this element in the next level.
- Height
- Number- The pixelheight of the element.
Must have a value for each element that ends with 1 (Menu1, Menu5_3_1) In all other elements this may be 0.
Elements in a vertical column may have different heights, all elements in a horizontal row get the height of the first element in that row
- Width
- Number- The pixelwidth of the element.
Must have a value for each element that ends with 1 (Menu1, Menu5_3_1) In all other elements this may be 0.
Elements in a horizontal row may have different widths, all elements in a vertical column get the width of the first element in that column
- BgColor
- Text string- Background color of this element when the mouse is not over the element.
When used it over rules the global variable LowBgColor
When not used it must be "". Can be a supported color name like red or blue or a RGB string like #ff552a.
- BgHiColor
- Text string- Background color of this element when the mouse is over the element.
When used it over rules the global variable HighBgColor
When not used it must be "". Can be a supported color name like red or blue or a RGB string like #ff552a.
- FontColor
- Text string- Font color of this element when the mouse is not over the element.
When used it over rules the global variable LowFontColor
When not used it must be "". Can be a supported color name like red or blue or a RGB string like #ff552a.
- FontHiColor
- Text string- Font color of this element when the mouse is over the element.
When used it over rules the global variable HighFontColor
When not used it must be "". Can be a supported color name like red or blue or a RGB string like #ff552a.
- BorderColor
- Text string- Border color of this group of elements.
Only the color of elements ending on 1 are used.
When used it over rules the global variable BorderColor
When not used it must be "". Can be a supported color name like red or blue or a RGB string like #ff552a.
Rate This Article
You must be logged in to rate articles.

