|
Highlight Selected Menu Items
|
Highlight selected menu item/subitem using dtreet_ext_setPressedItem () function.
function dtreet_ext_setPressedItem (menuInd, itemID)
Sets pressed item.
menuInd - index of a menu on a page, >= 0.
itemID - ID property of an item. You can find itemID using dtreet_ext_getItemIDByIndex (menuInd, itemInd) function, for example:
itemID = dtreet_ext_getItemIDByIndex(1,2)
See more info about indexes here.
To set a default selected item add '>' symbol before item's text:
var tmenuItems = [
["|||>My item - item is selected","","","","","","",""],
Expand/collapse item/subitem using dtreet_ext_expandItem () function.
function dtreet_ext_expandItem (itemID, expand)
Expands/collapses a specified item or a submenu.
itemID - ID property of an item. You can find itemID using dtreet_ext_getItemIDByIndex (menuInd, itemInd) function, for example:
itemID = dtreet_ext_getItemIDByIndex(1,2)
expand - 0 - expand the item, 1 - show the item.
See more info about indexes here.
To expand specific items by default add '+'symbol before item's text:
var tmenuItems = [
["|||+My item - item is expanded","","","","","","",""],
|
|
For example lets highlight "Purchase" item in the menu.
To do it you should call dtreet_ext_setPressedItem () function with the following parameters:
dtreet_ext_setPressedItem (1,dtreet_ext_getItemIDByIndex(1,21));
Highlight "Deluxe Tree/Purchase" item.
Define this function on each page before you call data file:
<script type="text/javascript">
onload=setPressed;
function setPressed()
{
dtreet_ext_setPressedItem (1,dtreet_ext_getItemIDByIndex(1,2));
}
</script>
<script type="text/javascript" src="menudir/data.js"> </script>
To highlight and expand "Deluxe Tree/Product Info/Installation" item you should call the following functions:
dtreet_ext_setPressedItem (1,dtreet_ext_getItemIDByIndex(1,5));
dtreet_ext_expandItem (dtreet_ext_getItemIDByIndex(1,2),1); //expand parent "Product Info" item
Highlight "Deluxe Tree/Product Info/Installation" item.
To highlight selected menu and expand "Samples Gallery/Samples Block 2/New Sample 3" item you should call the following functions:
dtreet_ext_setPressedItem (1,dtreet_ext_getItemIDByIndex(1,34));
dtreet_ext_expandItem (dtreet_ext_getItemIDByIndex(1,24),1); //expand parent "Samples Gallery" item
dtreet_ext_expandItem (dtreet_ext_getItemIDByIndex(1,31),1); //expand parent "Samples Block 2" item
Highlight "Samples Gallery/Samples Block 2/New Sample 3" item.
Click here to download this sample.
tmenuItems array
|
itemInd
Index of an item
|
submenuInd
Index of a submenu
|
var tmenuItems = [
["Home","testlink.html", "", "", "", "", "", "", "", "", "", ],
["Product Info","", "", "", "", "", "", "", "", "", "", ],
["|Features","testlink.html", "", "", "", "", "", "", "", "", "", ],
["|Installation","", "", "", "", "", "", "", "", "", "", ],
["||Description of Files","", "", "", "", "", "", ],
["||How To Setup","testlink.html", "", "", "", "", ],
["|Parameters Info","testlink.html", "", "", "", "", "", ],
["|Dynamic Functions","", "", "", "", "", "", "", "", "", "", ],
["|Supported Browsers","", "", "", "", "", "", "", "", "", "", ],
["||Windows OS","", "", "", "", "", "", "", "", "", "", ],
["||Internet Explorer","", "", "", "", "", "", "", "", "", "", ],
["||Firefox","", "", "", "", "", "", "", "", "", "", ],
["||Mozilla","", "", "", "", "", "", "", "", "", "", ],
["||Netscape","", "", "", "", "", "", "", "", "", "", ],
["||Opera","", "", "", "", "", "", "", "", "", "", ],
["||MAC OS","", "", "", "", "", "", "", "", "", "", ],
["||Firefox","", "", "", "", "", "", "", "", "", "", ],
["||Safari","", "", "", "", "", "", "", "", "", "", ],
["||Internet Explorer","", "", "", "", "", "", "", "", "", "", ],
["||Unix/Linux OS","", "", "", "", "", "", "", "", "", "", ],
["||Firefox","", "", "", "", "", "", "", "", "", "", ],
["||Konqueror","", "", "", "", "", "", "", "", "", "", ],
["Samples","", "", "", "", "", "", "", "", "", "", ],
["|Sample 1","testlink.html", "", "", "", "", "", "", "", "", "", ],
["|Sample 2 is Disabled","", "", "", "", "_", "", "", "", "", "", ],
["|Sample 3","testlink.html", "", "", "", "", "", "", "", "", "", ],
["|Sample 4","testlink.html", "", "", "", "", "", "", "", "", "", ],
["|Sample 5","testlink.html", "", "", "", "", "", "", "", "", "", ],
["|Sample 6","testlink.html", "", "", "", "", "", "", "", "", "", ],
["|Sample 7","testlink.html", "", "", "", "", "", "", "", "", "", ],
["|Sample 8","testlink.html", "", "", "", "", "", "", "", "", "", ],
["|Sample 9","testlink.html", "", "", "", "", "", "", "", "", "", ],
["Purchase","testlink.html", "", "", "", "", "", "", "", "", "", ],
["Contact Us","testlink.htm", "", "", "", "", "", "", "", "", "", ],
];
|
index=0
index=1
index=0
index=1
index=0
index=1
index=2
index=3
index=4
index=0
index=1
index=2
index=3
index=4
index=5
index=6
index=7
index=8
index=9
index=10
index=11
index=12
index=2
index=0
index=1
index=2
index=3
index=4
index=5
index=6
index=7
index=8
index=3
index=4
|
index=0
index=1
index=2
index=3
index=4
|
See more info about javascript dynamic menu functions.
|