Recent Questions Using Ajax Hover Menu In Treeview
Q: When I stay on one page (for example "Home") аlso must have the menu-point "home" another color or font. How can I make this?
A: You should set pressed item.
Please, check the following parameter
var pressedItem=-2;
This parameter sets an index of an item that will be highlighted by default.
-2 - the toggle mode is disabled;
-1 - the toggle mode is enabled, but no items highlighted by default;
0,1,2,3,... - index of highlighted item in a top-menu.
JavaScript Tree Menu v2.4 has only two states normal and mouseover. Now we'repreparing new version of JavaScript Tree Menu. It saves it state after thereloading of the page. We're planing to release a new version during a month.
You can set a pressed item using Javascript API:
function dm_ext_setPressedItem (menuInd, submenuInd, itemInd, recursion)
Sets a current pressed item.
menuInd - index of a menu on a page, >= 0.
submenuInd - index of a submenu, >= 0.
itemInd - index of an item, >=0.
recursion = true/false - highlight parent items.
But notice, to use dm_ext_setPressedItem() you should know ID of selected item and subitem.
You can't get this ID after you reload your page. That is why you should write your own code on PHP.
You can also set the correct
var pressedItem=1;
parameter on each html page.
Q: I like “popup-mode-sample” but I could make it to work on my computer.
? Could you help?
A: If your menu doesn't work you should check paths to your dmenu.js file andto dmWorkPath parameter.
Q: Is it possible to create expandable checkbox menu with you javascript dynamic tree menu?
(I want each tree menu element contain a check box and some text. )
A: No, unfortunately Javascript/DHTML Tree doesn't have such a feature now.
But you can paste any html code inside item text, for example:
["+Support", "", "icon5_t.gif", "icon5_to.gif", "", "Support Tip"],
["|Index <select style='width:120px;height:17px;font:normal 10px Tahoma,Arial;'><option>Section 1<option>Section 2<option>Section 3</select>","", "", "", "", "","", "0"],
["|Search <input type=text style='width:80px;height:17px;font:normal 10px Tahoma,Arial;'> <input type=button value='Go' style='width:30px;height:17px;font:normal 10px Tahoma,Arial;'>", "", "", "", "", "", "", "0"],
["|Write Us", "", ""],
["|<INPUT TYPE=checkbox CHECKED ID=chk1 onclick='choosebox1()'>Uncheck this check box for some free advice","","","",],
["<img src='img/sep.gif' width=113 height=1>"],
Q: I have small problems with your javascript menu system.
#1. I am creating a multi-level menu, am I limited to a gird format or can every item have a variable column width?
#2. With submenus, I want to have the submenu be the same width as the parent cell, is there a simple command for this, or do I have to guess the column widths until it fits correctly?
#3. In those same submenus, I have items that are longer than the parent, is there a word wrap or a way to define a break, rather than having the scroll feature?
A: 1) You should use Individual Item Styles.
For example:
var itemStyles = [
["itemWidth=120","itemBorderWidth=1","itemBorderStyle=solid,solid","itemBackColor=#ACF88B,#ACF88B","itemBorderColor=#329309,#329309"], //style0
["itemWidth=100","itemBorderWidth=1","itemBorderStyle=solid,solid","itemBackColor=#FFFFFF,#FFFFFF","itemBorderColor=#1B92E9,#1B92E9"], //style1
["itemWidth=130","itemBorderWidth=1","itemBorderStyle=solid,solid","itemBackColor=#FF9684,#FF9684","itemBorderColor=#EC7575,#EC7575"], //style2
["itemWidth=150","itemBorderWidth=1","itemBorderStyle=solid,solid","itemBackColor=#84F9FF,#84F9FF","itemBorderColor=#00B8C1,#00B8C1"], //style3
];
var menuStyles = [
["smColumns=2"], //style0
];
["Home","testlink.htm"],
["Samples","testlink.htm"],
["|Group 1","", , , , , "0", , , ],
["|Group 2","", , , , , "1", , , ],
["|Group 3","", , , , , "2", , , ],
...
[" More Samples","testlink.htm"],
["|Group 1","", , , , , "3", "0", , ],
["|Group 2","", , , , , "1", , , ],
Where "0", "1", "2", "3" - style number in itemStyles.
2) You can also use Individual Item Styles.
var itemStyles = [
["itemWidth=120px"],
];
var menuStyles = [
["smWidth=120px"],
];
["Product Info","", "default.files/icon1.gif", "default.files/icon1o.gif", , , "0", , , ], // itemStyles
["|Features","testlink.html", "default.files/icon2.gif", "default.files/icon2o.gif", , , , "0", , ],
["|Installation","", "default.files/icon2.gif", "default.files/icon2o.gif", , , , , , ], // menuStyles
3) Try to set this parameter:
var noWrap=0;