Recent Questions
Q: Is there any way to have the browser reset the horizontal tree view to allcollapsed each time the browser is reopened?
A: You should set the following parameter in that case:
var tsaveState=0;Q: What can I do to optimize the load time for dhtml rollover
and prevent reloading it from the server with every page reload.
A: You can try to use AJAX technology.
AJAX-like technology: data for submenus can be loaded "on-the-fly" from the server.
New parameter:
var tajax = 0/1; - disables/enables AJAX-like support
Current syntax for item parameters ( var tmenuItems):
[text, link, iconNormal, iconOver, iconExpanded, tip, target, itemStyleInd, itemXPStyleInd, jsFileName]
Where jsFileName - .js filename on the server with submenu items ( var tmenuItems).
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;
Q: Can I add the value of the parameter to the link where I want my application to go when I active a submenu in the menu script?
A: Actually you can add php code inside menu links.
If you define your parameter in .js file you should write yourlinks in the following way, for example:
<?
....
$key = 123456;
....
?>
["Home","www.domain.com/home.php?key=<? echo $key ?>", "", "", "", "", "", "", "", ],
If you define your key parameter in the php file you should move your
menuItems into your php page directly:
<?
....
$key = 123456;
....
?>
<script type="text/javascript">
var tmenuItems = [
['Deluxe Menu','http://deluxe-menu.com','icon.gif',,,,,],
['Deluxe Tree','http://deluxe-tree.com','icon.gif',,'New!',,,],
['Deluxe Tabs','http://deluxe-tabs.com','icon.gif',,'New!',,,],
["Home","www.domain.com/home.php?key=<? echo $key ?>", "", "", "", "", "", "", "", ],
];
dm_init();
</script>