affordable web development services
| About Us | Services | Download | Order | Support | Subscribe to News Feed Follow us on Twitter Join us on Facebook |
 

Tigra Menu GOLD v2.6 - Documentation

Table of Contents

Description

Tigra Menu Gold is a cross browser Javascript Menu navigation component for web sites. Script provides efficient supporting of most complete feature set.

Features

This is what we call the most complete feature set:

Compatibility Table

Tigra Menu GOLD is designed to efficiently employ maximum capabilities of the visitor's browser while keeping code size compact for both script files and configuration.
Here is a table of the application compatibility:

Platform Browser
MS IE Netscape Mozilla Opera AOL Safari
Windows 95/98/ME/2000/XP 4.0+ 4.08+ 0.9+ 5.0+ 4+ n/a
Mac OS 8/9/X 5.0+ 4.7+ 1.0+ 5.0+ n/a 1.0+
KDE on Linux/FreeBSD n/a n/a 1.1+ n/a n/a n/a

Files

Although all data required for menu to function properly may reside in single html document it is not efficient in most cases. Dividing data into several files makes menu maintenance easier. This technique also reduces network load allowing clients to use cached files on sites with multiple pages.

Default configuration contains:

File indexes may be added to file names and structure names if multiple menus used. For example style sheet for menu with index 1 may have name menu1.css.

All menu.css, menu.js, items.js and template.js files should be attached to HTML document with appropriate tags in header:

<head>
	<!-- some header data -->
	<link rel="stylesheet" href="menu.css">
	<script language="JavaScript" src="menu.js"></script>
	<script language="JavaScript" src="items.js"></script>
	<script language="JavaScript" src="template.js"></script>
</head>

Script automatically links portion of code that best employs capabilities of the browser visitor uses. Modify TMenu_path_to_files variable in menu.js for script to know where to look for menu files

var TMenu_path_to_files = 'menu_files/';

Always make sure pixel.gif file is located by the path specified in TMenu_path_to_files as well as menu core file (menu.js) and browser-dependent library files (menu.dom.js, menu.lay.js and menu.opr.js).

Adding Menus to Page

In order for the menu to work, all required files should be included into HTML document. Then a function of menu constructor - new menu() - is called for each menu instance on the page. Constructor for each menu receives two to three parameters:

  1. Menu Items structure - required
  2. Menu Geometry structure - required
  3. Menu Scope Setting structure - optional, can be omitted

Menu Scope Setting Structure

Menu scope setting structure is JavaScript structure to set global menu behavior parameters. Below is a table of keys supported by the structure

Key Description Accepted Values If omitted or null the menu ...
frames Supplies to a menu how frames it should operate through are located in a frameset 2-dimentional array of strings ... works like not in a frameset
key Alternative key name for the menu a string ... takes zero-based index of all menus on a page in an order of how they are called
forms Makes submenu blocks to hide select boxes of specified HTML form elements on menu drop-down (pop-up) if select boxes can not be overlapped in a browser array of strings those are form names ... does not hide select boxes if they can not be overlapped
popup Makes menu root level to be initially invisible and to become invisible on total menu collapse.
If contains a name of existing image on current page, menu root level offsets will be relative to that image top left corner
any ... root level is initially visible
zIndex Menu base z-index, is stating counting point for all menu z-indexes. Set its value if menu is needed to overlap certain other layers in the HTML document an integer number ... root level has z-index of 0
showroot A value adequate to JavaScript true makes menu root level to be always visible if cross-frame. Useful when menu root level partialy located in other than master frame. Makes sence in only cross-frame mode. boolean ... slave copy will hide its root level
wrapper A JavaScript function "wrap" menu items content with. It is to be called while every item building and item content and its state as two parameters. Function shold return appropriate content for the item. a function ... menu items' content will not be additionally processed
Event processing
clickcollapse Switches menu collapse after any item click to be on. boolean true of false ... will not be collapsed on any item click unless 'cc' item scope structure key says the opposite
onexpand A JavaScript function to be called before menu expansion if it is collapsed.
Usefull for hiding objects on the page that can not be covered with submenus.
a function ... no function will be called instead
oncollapse A JavaScript function to be called after total menu collapse.
Usefull for showing objects hidden with onexpand key handler.
a function ... no function will be called instead

Any of the above keys can be omitted.

Menu Pop-up Mode

By default Tigra Menu GOLD root level is always visible on the page. However, there is a way to make it hidden and appearing/disappearing only on certain event. Such behavior is available when the menu is in pop-up mode. It can be useful if you wish to build context menus, for instance.

To switch menu pop-up mode on just specify a value not equal to 0, null or '' for 'popup' key of menu scope settings structure. Menu root level will be initially hidden then.

To show the root level just handle expand() menu method call on desired event and to hide it place onmouseout(0) menu method call. Suppose you have a menu appearing when mouse pointer hovers over "show menu" link and disappearing when the pointer goes away from it. Here are the code samples:

<script language="JavaScript">
	myMenu = new menu (MENU_ITEMS, MENU_POS, {'popup' : 1});
</script>
<!-- any HTML code here -->
<a href="" onmouseover="myMenu.expand()" onmouseout="myMenu.onmouseout(0)">show menu</a>

In above example myMenu is a variable reference to a menu object. Such way helps to identify the menu.

Hiding Forms

Browsers such as Netscape Navigator 4.x and Opera 6.x- are unable to render any HTML element to overlap HTML form controls, so Tigra Menu GOLD is built to hide HTML forms at all for those browsers. To make this feature work you should place a form to be hidden on menu expanding into HTML element which can be hidden by JavaScript, for instance, <div style="position:relative"> tag. If there are several forms to make hidable in a document, place each of them into such tags. Then give names and ids to all of those tags: <div style="position:relative" name="toHide" id="toHide">. Now just pass an array of the above block names or ids as a fifth parameter to a menu initialization block:

<script language="JavaScript">
	// build a menu which will hide 2 forms if expanding in NN4.x or Opera
	new menu (MENU_ITEMS, MENU_POS, {'forms' : ['toHide0', 'toHide1']});
</script>

Symbolic Name

Symbolic name can be assinged to the menu instance. It is useful when you use several menu instances across a frameset to avoid menu initialization blocks to mix menus up. Then this name can be used instead of numeric menu index for instance references. To set a name for the menu put string value as last parameter of menu initialization block:

<script language="JavaScript">
	new menu (MENU_ITEMS, MENU_POS, {'key' : 'myGold'});
</script>

Page Without Frames

Menu initialization block should be placed where you want to see the Menu on your web page:

<script language="JavaScript">
	new menu (MENU_ITEMS, MENU_POS);
</script>

Case with three menus on the page may look like:

<script language="JavaScript">
	new menu (MENU_ITEMS1, MENU_POS1);
	new menu (MENU_ITEMS2, MENU_POS2);
	new menu (MENU_ITEMS3, MENU_POS3);
</script>

Page With Frames

Tigra Menu GOLD can be configured to work with web sites utilizing frames. Menu blocks can overlap frame borders as if page was solid HTML document.

The Dynamic HTML (DHTML) and Document Object Model (DOM) don't provide native support for this feature that's why this popular feature is not offered by most JavaScript menus. The elements menu is built of can't extend beyond the edge of the document they were created in. We solve the problem by creating the fragments of the menu in different frames and then synchronizing them so they look and act as one menu. This trick comes with some limitations that you should be aware of:

Above requirements only apply to documents in frames that menu will overlap (cover).

Follow steps below to configure Tigra Menu GOLD for usage with frames:

1. Link menu files and add menu initialization block to all HTML documents menu can appear over
Example: If some document is expected to be loaded in content frame of your site then you should insert menu code into it

Document's header:

<head>
	<!-- some header data -->
	<link rel="stylesheet" href="menu.css">
	<script language="JavaScript" src="menu.js"></script>
	<script language="JavaScript" src="menu_items.js"></script>
	<script language="JavaScript" src="menu_tpl.js"></script>
</head>

Document's body:

<script language="JavaScript">
	new menu (MENU_ITEMS, MENU_POS);
</script>

Insert menu initialization blocks just before </body> tags in all content (slave) documents. Master document - the one that loads in navigation frame, should have initialization block correctly positioned in the code, as it is done in a single-frame case.

The moment of choosing 'master' is essential regardless of which frameset and of how many frames you are building: one frame which does not tend to be reloaded should be chosen as 'master' for the menu.

2. Once we insert 'master' <script></script> tags into its source exactly in the place we want the menu to appear we are ready to compose frameset description structure - JavaScript array, containing line-by-line column-by-column frames' names. For instance, frameset looking like this:

A B
C D E

should be described as:

var MENU_FRAMES = [
	['A', 'B'],
	['C', 'D', 'E']
]

If framesets are nested (one of the frames contains html document with frames) then frame is referenced with parent and own name separated by a dot (.).

3. Specify the name of frameset description structure as third parameter in menu initialization block of the master frame.

<script language="JavaScript">
	new menu (MENU_ITEMS, MENU_POS, {'frames' : MENU_FRAMES});
</script>

If you use several cross-frame menu instances, you should use the same predefined menu indexes as the last parameter at initialization blocks for all frames a menu will operate through to avoid slave menus mixing up.

Master frame:

<script language="JavaScript">
	new menu (MENU_ITEMS, MENU_POS, {'frames' : MENU_FRAMES, 'key' : 'myMenuGold'});
</script>

Slave frame(s):

	<script language="JavaScript">
		new menu (MENU_ITEMS, MENU_POS, {'key' : 'myMenuGold'});
	</script>
</body>
</html>

Notes: Nested frames support is implemented in versions 1.2 and later.

Framesets looking like

A B
C

are supported in versions 2.4 and later. The description structure for such sample is the following:

var MENU_FRAMES = [
	['A', 'B'],
	['A', 'C']
]

Even if the menu is needed to operate in only one frame of a frameset the frameset description structure should be supplied to the menu constructor. For instance, of the above sample frameset you need a menu in only frm0 frame, the constructor call for that frame (no calls needed in other frames) will look like:

<script language="JavaScript">
	new menu (MENU_ITEMS, MENU_POS, {'frames' : [['frm0']]});
</script>

Building Menu Hierarchy

Menu items are JavaScript structure that describes menu elements and they relations in menu hierarchy. Item's individual parameters are configured within this structure as well.

Structure assigned array value with list of root items. Each item is array itself containing one or more elements. Those elements are:

Notes:

Item Caption

Caption defines text or html that will be printed within item's rectangle. This field may be assigned string or three element array with captions for different states of item. Those states are:

Picture and code sample below show how caption is defined for menu item.

var MENU_ITEMS = [
	// level 0 item 0
	[[
		'<span style="color: green;">State is mout</span>',
		'<span style="color: orenge;">State is mover</span>',
		'<span style="color: red;">State is mdown</span>',
	], "javascript: alert('Click!')"],

	// level 0 item 1
	['Contact', "mailto:[email protected]"]
]

Item Link

Link defines text to be inserted into href attribute of item's anchor tag. Usually this is page URL, but any appropriate value is possible.

var MENU_ITEMS = [
	['level 0 item 0', 'http://www.softcomplex.com/'], // Site URL
	['level 0 item 1', 'ftp://ftp.microsoft.com/'], // Link to FTP
	['level 0 item 2', 'mailto:[email protected]'], // Mailto link
	['level 0 item 3', 'javascript:alert("Hello World!");'], // Script statement
];

Submenu Block Items

Any item may have unlimited count of sub items. All sub items are defined using the same rules as were used for creation of the item itself. See code sample above.

Menu Level Scope Settings

By default Menu Template settings are located in menu_tpl.js file but they can be moved to any other JavaScript file linked to the HTML document containing the menu. This configuration code can also be inserted within <script> tag into HTML document itself.
Menu template structure is JavaScript associative array that describes how menu blocks and items are positioned and sized, how they look and behave at each level. Below is the list of supported keys with descriptions.

Configuration keys for menu level scope settings
Key Description Accepted Values Default Value
 
General
width Horizontal size of an item in a submenu block, pixels A positive integer number none
height Vertical size of an item in a submenu block, pixels A positive integer number none
left Indicates horizontal direction of a submenu block expansion.

Non-negative value makes the block to be expanded rightward, negative value makes the block to be expanded leftward
An integer number null (rightward)
top Indicates vertical direction of a submenu block expansion.

Non-negative value makes the block to be expanded downward, negative value makes the block to be expanded upward
An integer number null (downward)
block_top Vertical offset of the upper left corner of a block relatively to the upper left corner of the parent item, in pixels.

If is set for root level (the one with index 0) makes the menu to be positioned in absolute way.
An integer number none
block_left Horizontal offset of the upper left corner of a block relatively to the upper left corner of the parent item, in pixels.

If is set for root level (the one with index 0) makes the menu to be positioned in absolute way.
An integer number none
vertical Block orientation:
vertical - next item goes under current one
horizontal - next item goes to the right of current one
true - vertical
false - horizontal
false
table A JavaScript array of parameters for an outer table of a submenu block:
[cellpadding, cellspacing, border]
[<non negative integer>, <non negative integer>, <non negative integer>] [0, 0, 0]
Delays
expd_delay A time delay between moments of mouse pointer goes over an item and of corresponding submenu block expanding. In most cases there is no need to expand all blocks whose parent items a mouse pointer goes over, but only the last one. So this parameter will be useful. Makes an effect for all but the most subling level submenu blocks.
If less than 0 sub-menus are expanded on click
An integer number or null 0
hide_delay A time delay between moments of mouse pointer goes from above an item and of corresponding submenu block collapsing. Menu items may have some spacing between so the delay is applied before menu collapses after mouse pointer left the item. The bigger distances the more delay may be required.
Is not taken into account for root level (the one with index 0)
A positive integer number or null 0
Behavior and look
wise_pos An index of a behavior type of a submenu block if crossing a browser window border.
Is not taken into account for root level (the one with index 0).
0 - do nothing
1 - shift a submenu block toward the window area to fit it
2 - flip a submenu block relatively to its left upper corner toward the window area
0
transition A JavaScript array for control of transition effects:
[<on block expand transition effect>, <on block collapse transition effect>]
Is not taken into account for root level (the one with index 0)
[transition definition, transition definition] no transitions
opacity A percentage value of menu blocks opacity 0 (full transparency) .. 100 (full opacity) 100
Shadow
shadow An associative JavaScript array for defining parameters of a shadow dropped by a submenu block   no shadow
  offX Horizontal offset of the upper left corner of a shadow relatively to the upper left corner of a corresponding submenu block, in pixels. An integer number none
offY Horizontal offset of the upper left corner of a shadow relatively to the upper left corner of a corresponding submenu block, in pixels. An integer number none
color A color of a shadow Any valid HTML color value none
Styles
css An associative JavaScript array for defining item styles   no styles
  table A style class for an outer table of a submenu block Any valid style class name no style
outer A style class(es) for an outer tag for each state of an item.
If defined as a JavaScript three-celled array then contains style class names for each item's state: [mouseout, mouseover, mousedown];
If defined as a string then there is style class name for all item's states
An array of any three valid style class names
or
any valid style class name
no style(s)
inner A style class(es) for an inner tag for each state of an item.
If defined as a JavaScript three-celled array then contains style class names for each item's state: [mouseout, mouseover, mousedown];
If defined as a string then there is style class name for all item's states
An array of any three valid style class names
or
any valid style class name
no style(s)

Each level of menu is configured independently. But there is a way to inherit configuration from previous menu level, e.g. if second and third menu level configurations are identical you don't need to describe the third level in the configuration settings. Level configuration will be inherited from the previous level if omitted or declared as JavaScript null. For instance:

{ // Level 3 configuration
'height' : 25,
'width' : 160,
'table' : [0, 1, 0],
'block_top' : 10,
'block_left' : 120,
'wise_pos' : 1,
'hide_delay' : 200,
'expd_delay' : 300,
'transition' : [null, null, 6, 0.4],
'opacity' : 70
'css' : {
'table' : 'menu0table',
'outer' : ['menu0outo', 'menu0overo', 'menu0downo'],
'inner' : 'menu0inner'
}
},
{ // Level 4 configuration
'height' : 25,
'width' : 160,
'table' : [0, 1, 0],
'block_top' : 10,
'block_left' : 120,
'wise_pos' : 1,
'hide_delay' : 200,
'expd_delay' : 300,
'transition' : [null, null, 6, 0.4],
'opacity' : 70
'css' : {
'table' : 'menu0table',
'outer' : ['menu0outo', 'menu0overo', 'menu0downo'],
'inner' : 'menu0inner'
}
}
  Can be
replaced
with
 
{ // Level 3, 4 configurations
'height' : 25,
'width' : 160,
'table' : [0, 1, 0],
'block_top' : 10,
'block_left' : 120,
'wise_pos' : 1,
'hide_delay' : 200,
'expd_delay' : 300,
'transition' : [null, null, 6, 0.4],
'opacity' : 70
'css' : {
'table' : 'menu0table',
'outer' : ['menu0outo', 'menu0overo', 'menu0downo'],
'inner' : 'menu0inner'
}
}

Parameters assigned array value. Each element of array corresponds menu level with the same index. More levels expected - more elements required for each parameter. Given menu example has four levels so all arrays have four elements as well.

Menu Positioning. Sizes and Offsets

By default Tigra Menu GOLD is positioned relatively. It means the menu root level will be drawn out in a place where its constructor (new menu()) is called. So you can place the menu in any containing HTML element, e.g <table> and align it on the page in the way you wish.

However, there is a way to position the menu on the page relatively to its top left corner, absolutely. It is useful when the menu is desired to cover certain HTML elements.

To switch absolute positioning on just set a value for block_left and/or block_top keys of menu root level scope settings structure. The menu root level will be shifted from the page top left corner by block_left pixels rightward and by block_top pixels downward. If both keys are omitted for menu root level the menu will be positioned relatively.

Picture and code sample below show how menu size and offset parameters are set with JavaScript structure. Cases illustrated are highlighted in code sample with blue background.

var MENU_POS0 = [
// Level 0 block configuration { 'height': 25, 'width': 100, // C. 'table': [0, 1, 0],
'vertical' : false
}, // Level 1 block configuration {
'width' : 130, // A.
'height' : 25, // B.
'table' : [0, 1, 0],
'block_top' : 20,
'block_left' : 11, 'vertical' : true
}, // Level 2 block configuration { 'height' : 25, // D.
'width' : 160,
'table' : [0, 1, 0], 'block_top' : 10, // F. 'block_left' : 120, // E.
'vertical' : false
} ]

Block Orientation

Items of menu blocks of certain level can follow each other either vertically or horizontally. That is set by 'vertical' key of configuration description structure for the correspondent menu level:

Item 1
Item 2
Item 3
Item 1 Item 2 Item 3
{
'height' : 20,
'width' : 120,
'table' : [0, 1, 0],
'vertical' : true,
}
{
'height' : 20,
'width' : 120,
'table' : [0, 1, 0],
'vertical' : false,
}

 

Outer Table

All menu block items are included into a table. Cellpadding, cellspacing and border modifiers for such table of the certain level are assigned to a JavaScript array with key of 'table' of configuration description structure for the correspondent menu level

Item 1
Item 2
Item 3
{
'height' : 20,
'width' : 120,
'table' : [0, 5, 2],
'vertical' : true,
}

Wise Block Positioning

If operating in a single frame menu can be configured so that blocks always appear on a visible page area if it is possible. There are two ways of block behaviour once not fit onto page frame:

Block is flipped relatively to its left upper corner:
{
'height' : 20,
'width' : 120,
'table' : [0, 1, 0],
'block_top' : 15,
'block_left' : 105,
'wise_pos' : 2,
'vertical' : true,
}
Block is shifted to the window border:
{
'height' : 20,
'width' : 120,
'table' : [0, 1, 0],
'block_top' : 15,
'block_left' : 105,
'wise_pos' : 1,
'vertical' : true,
}

All other values of wise_pos key are supposed to be 0 e.g. wise positioning is off (always if multiple frames).

Transition Effects

Transition effect settings are taken into account for MS Internet Explorer 5+ browsers only. Effect can be applied on block expand and/or on block collapse. There is a way to set an effect for menu level scope and for separate submenu block as well

'transition' key is 2-celled array, the first one an effect for a submenu expansion and the second one is for the submenu collapse. Each cell can have one of the following values (are given with their descriptions):

Effect string valueDescription
revealTrans(TRANSITION=0,DURATION=t)Box in
revealTrans(TRANSITION=1,DURATION=t)Box out
revealTrans(TRANSITION=2,DURATION=t)Circle in
revealTrans(TRANSITION=3,DURATION=t)Circle out
revealTrans(TRANSITION=4,DURATION=t)Wipe up
revealTrans(TRANSITION=5,DURATION=t)Wipe down
revealTrans(TRANSITION=6,DURATION=t)Wipe right
revealTrans(TRANSITION=7,DURATION=t)Wipe left
revealTrans(TRANSITION=8,DURATION=t)Vertical blinds
revealTrans(TRANSITION=9,DURATION=t)Horizontal blinds
revealTrans(TRANSITION=10,DURATION=t)Checkerboard across
revealTrans(TRANSITION=11,DURATION=t)Checkerboard down
revealTrans(TRANSITION=12,DURATION=t)Random dissolve
revealTrans(TRANSITION=13,DURATION=t)Split vertical in
revealTrans(TRANSITION=14,DURATION=t)Split vertical out
revealTrans(TRANSITION=15,DURATION=t)Split horizontal in
revealTrans(TRANSITION=16,DURATION=t)Split horizontal out
revealTrans(TRANSITION=17,DURATION=t)Strips left down
revealTrans(TRANSITION=18,DURATION=t)Strips left up
revealTrans(TRANSITION=19,DURATION=t)Strips right down
revealTrans(TRANSITION=20,DURATION=t)Strips right up
revealTrans(TRANSITION=21,DURATION=t)Random bars horizontal
revealTrans(TRANSITION=22,DURATION=t)Random bars vertical
revealTrans(TRANSITION=23,DURATION=t)Random of all above
blendTrans(DURATION=t)Blending effect
progid:DXImageTransform.Microsoft.Wheel(DURATION=t,spokes=5)
progid:DXImageTransform.Microsoft.Barn(DURATION=t,orientation=horizontal)
progid:DXImageTransform.Microsoft.Blinds(DURATION=t,bands=5)
progid:DXImageTransform.Microsoft.CheckerBoard(DURATION=t)
progid:DXImageTransform.Microsoft.Fade(DURATION=t)
progid:DXImageTransform.Microsoft.GradientWipe(DURATION=t,wipeStyle=0)
progid:DXImageTransform.Microsoft.Iris(DURATION=t,irisStyle=STAR)
progid:DXImageTransform.Microsoft. (DURATION=t,irisStyle=CIRCLE)
progid:DXImageTransform.Microsoft.Pixelate(DURATION=t,maxSquare=40)
progid:DXImageTransform.Microsoft.Wheel(DURATION=t,spokes=5)
progid:DXImageTransform.Microsoft.RandomDissolve(DURATION=t)
progid:DXImageTransform.Microsoft.Spiral(DURATION=t)
progid:DXImageTransform.Microsoft.Stretch(DURATION=t,stretchStyle=push)
progid:DXImageTransform.Microsoft.Strips(DURATION=t,motion=rightdown)

Note: In above table t stands for an effect duration time in seconds

If you would like to have horizontal blinds for a half a second both for expand and collapse just specify:

'transition': ['revealTrans(TRANSITION=9,DURATION=0.5)',
'revealTrans(TRANSITION=9,DURATION=0.5)']

Setting Styles

As mentioned above any menu item may have three states: when mouse pointer is out of the item ("mouseout"), over the item ("mouseover") and item click ("mousedown"). With Tigra Menu Gold it is possible to define styles for a whole block and for any state for any level of any menu on the page.

Caption of any item is printed within two tags basically like this:

<div class="some_class_for_outer_tag">
<div class="some_class_for_inner_tag">
caption text
</div>
</div>

Styles may be defined for both tags. Usually attributes for item rectangle are assigned to outer tag (i.e. background, border etc.) and attributes for text to inner tag (i.e. font, size, color etc.)

Each level can have css key in its configurational structure. This key may contain the following subkeys:

table - style class name for <div> tag which every menu block table is included into
outer - for item's outer tag; if JavaScript array then contains style class names for each item's state [mouseout, mouseover, mousedown]; if string then is style class name for all item's states
inner - for item's inner tag; if JavaScript array then contains style class names for each item's state [mouseout, mouseover, mousedown]; if string then is style class name for all item's states

Any of css key subkeys can be omitted as well as the whole css key.

Here is a sample of css structure:

  'css' : {
'table' : 'menu0table', // menu block table
'outer' : ['menu0outo', 'menu0overo', 'menu0downo'], // item's outer tag: [mouseout, mouseover, mousedown]
'inner' : 'menu0inner' // item's inner tag, the same class for all states
}

You should note that not all browsers render style sheets the same. Always test your configuration with all versions expected.

Item Scope Settings

Tigra Menu GOLD item scope settings can be defined locally for particular item. Logically item scope settings take precedence of level scope settings, so if assigned, the local value overrides one set for whole menu level.
Item scope settings are defined in form of associative array which specifies local settings for item target, sizes, hint message, window status bar message, submenu block offsets and sizes. This structure is inserted as third parameter of the item in hierarchy structure. Menu template structure is JavaScript associative array which defines default item sizes, submenu block offsets, orientation, expand and collapse delays, transition effects, shadow settings and styles. Below there is a list of supported keys with their descriptions.

Configuration keys for menu item scope settings
Key Description Accepted Values
 
General
tw Name of the target frame or window for all item's links some_name - in framed layout pages will be opened in the frame with this name, if there is no frame with such name or if in non-framed layout pages will be opened in newly created window. Following links will reuse same window.
_self - in framed layout the link will be opened in the same frame where menu appears. In non-framed layout same window will be used for linked documents. This setting is normally used as default target for non-framed layouts
_blank - each link will be opened in the new window
_parent - in framed layout targeted document will be loaded in main window of the frameset, in non-framed layout it is equivalent to _self target
_top - in framed layout targeted document will be loaded in most outer window of the frameset, in non-framed layout it is equivalent to _self target
tt Tooltip - the text that will appear in pop-up box when mouse stays for some time over the item Any text
ti Tab index - a number of Tab key pressings needed to pass the focus to that item link. Does not work for invisible items A non-negative number
sb Status bar message - the text that will appear in the status bar of the window when mouse moves over the item Any text
be Custom transition effect for a block [string, string]
Item sizes
sw Width of the item in pixels. Takes precedence over all other width settings but is taken into account for horizontally oriented submenu blocks only. A positive integer number
sh Height of the item in pixels. Takes precedence over all other height settings but is taken into account for vertically oriented submenu blocks only. A positive integer number
Item child block sizes and offsets
bw Width of the item child block in pixels. Takes precedence over a corresponding level template settings but is taken into account for vertically oriented submenu blocks only. A positive integer number
bh Height of the item child block in pixels. Takes precedence over a corresponding level template settings but is taken into account for horizontally oriented submenu blocks only. A positive integer number
bl Horizontal offset of the upper left corner of the item child block relatively to the upper left corner of the item, in pixels. Takes precedence over a corresponding level template settings. An integer number
bt Vertical offset of the upper left corner of the item child block relatively to the upper left corner of the item, in pixels. Takes precedence over a corresponding level template settings. An integer number
Event handling
oh A JavaScript routine to execute when mouse pointer goes above the item A function
oo A JavaScript routine to execute when mouse pointer goes from over the item A function
cc Switches menu collapse after this item click to be on. Overrides a value of the same purpose key of menu scope setting structure - clickcollapse Boolean

Notes:

Using Inner Html

Any HTML is allowed within items caption (see Building Menu Hierarchy). This makes Tigra Menu GOLD powerful dynamic pages building engine that allows easy creation of professional sites without even worrying about browsers that clients use. With those features you may write cascading pages with images and so forth.

Suppose you have several menu items to be filled with a complex HTML code and having a difference in only their captions. The simpliest way of including such items in menu hierarchy is to repeat the same HTML code for as many times as a number of similar items you need is. But there is a way to get rid of those repeating. You can use special JavaScript functions to attach the same or similar HTML code to certain menu item captions - to wrap them with an additional code. We call such funtions wrappers herein. Wrappers symplify menu maintenance and reduce network usage as well.

Tigra Menu GOLD supports

Use of Global Wrapper

Global wrapper is a JavaScript function to add an additional HTML code to a caption of every menu item. It is called while menu script builds an item and receives two parameters:

1 - a caption of menu item to be wrapped, string
2 - a state of item at which the wrapper has to be applied, number

The function has to return a string which will be used instead of item caption.

To assign a function to be a global wrapper for the menu specify a reference or definition of the function as a value for wrapper key of menu scope setting structure.

There is a sample wrapping function code below:

function myWrapper (s_text, n_state) {
  // an array of colors for all three item states
  var a_colors = ['green', 'orange', 'red'];
  return '<span style="color: ' + a_colors[n_state] + ';">' + s_text + '</span>';
}
// Sample menu constructor line to plug the funtion to the menu
myMenu = new menu (MENU_ITEMS, MENU_POS, {'wrapper' : myWrapper});

Above defined function will return green menu item text for normal, orange for mouseovered and red for clicked menu item state.

Writing In-Hierarchy Wrappers

If only certain menu item are needed to be wrapped or there several different wrapping functions are to be used it is rational to use in-hierarchy wrappers. The concept is to declare such functions separately and than use their references directly in menu item hierarchy declaration. Having demo structure from section of Building Menu Hierarchy in-hierarchy wrappers may look like the following:

function wrap_grn (text) {
  return '<span style="color: green;">' + text + '</span>';
}
function wrap_org (text) {
  return '<span style="color: orange;">' + text + '</span>';
}
function wrap_red (text) {
  return '<span style="color: red;">' + text + '</span>';
}
var MENU_ITEMS = [
// level 0 item 0
  [[wrap_grn('State is mout'),
    wrap_org('State is mover'),
    wrap_red('State is mdown')
  ], "javascript:alert('Click!')"],
// level 0 item 1
  ['Contact', "mailto:[email protected]"],
];

or even simplier solution:

function wrap (text, color) {
	return '<span style="color: ' + color + ';">' + text + '</span>';
}
var MENU_ITEMS = [
	// level 0 item 0
	[[wrap('State is mout', 'green'),
		wrap('State is mover', 'orange'),
		wrap('State is mdown', 'red')
	], "javascript:alert('Click!')"],
	// level 0 item 1
	['Contact', "mailto:[email protected]"],
];

This technique may not pay much on small menu hierarchies or if only few items have html decoration, but it definitely should be used on large menus with rich formatting within items.

Code of the wrappers may be saved together with menu items structure in the same file, keeping clear logical structure of menu configuration.

Styles vs. Inner Html

As you could see it is possible to achieve the same visual effects with both styles and inner html. Although styles are easier to manipulate and experiment with, inner html may provide higher browser compatibility level. It is highly desirable to use generic compatible html within items together with wrappers if all potential of Tigra Menu Gold is required no matter what browser version is used.

Terms and Conditions

Regular License

One Regular Tigra Menu GOLD script license gives the right to use one copy of the script (all copies of files: menu_files/menu.js, menu_files/menu.dom.js, menu_files/menu.lay.js, menu_files/menu.opr.js) within single domain boundaries.

Demo of Licensing Cases:
First Site URL Second Site URL Number of Licenses Required
http://www.domain.com/site_1/ http://www.domain.com/site_2/ one
http://www.domain1.com/ http://www.domain2.com/ two
http://subdomain1.domain.com/ http://subdomain2.domain.com/ two

To finalize registration process owner of the script license should provide SoftComplex Inc. with domain name which license is associated with.

Developer License

Developer license gives the right to include unlimited number of Tigra Menu GOLD instances in the products of license owner. Such kind of license is obtained automatically by those who have 9 or more regular licenses.

Discounts

We offer 50% discount for the script starting from second license. To take advantage of this discount use the link sent with every order confirmation message.
Same discount initially applies to educational and religious organizations.

Usage

As owner of the Tigra Menu Gold license You are allowed to configure the script in any possible way for use in Internet (public), Intranet (corporate) or offline application, however You are strictly NOT allowed (unless specifically authorized by SoftComplex.com) to:

Technical Support

You are entitled to free product upgrades and technical support for at least one year from the date of purchase. Technical support includes answers to script related questions via e-mail and/or Internet instant messaging services. Full customization services are provided on customer's request at additional charge.

Violations of Terms and Conditions

Should you violate these Terms and Conditions or any other rights of SoftComplex Inc., SoftComplex Inc. reserves the right to pursue any and all legal and equitable remedies against you without limitation.

Links and references