Recent Questions
Q: Is there a way to change the height of the main buttons in Dhtml Menu. When I use the GUI tool there is nowhere to change the main button height. And when I tried to change it in the script file, it did me no good. I want all of the main buttons to be the same size.
A: You can use standard <img> object to set menu height, for example:
var menuItems = [
[" <img src='blank.gif' width=1 height=50>text"],
];
Q: Couple last questions. I have 25 icons (images) on one page. Each image needs it's own popup menu. Obviously I now have the first one working. How and where do I define IDs number 2-24 ? Does each icon need it's own "source_" file?
Also, where is it defined that the popup menu is ID 1 ?
A: > Also, where is it defined that the popup menu is ID 1 ?
Each menu has ID. The ID's number starts with 0.
So, when you have several data files on your page you have such ID's:
<script type="text/javascript" language="JavaScript1.2" src="menu-top.js"></script> // ID - 0
<script type="text/javascript" language="JavaScript1.2" src="source_pop.js"></script> // ID - 1
<script type="text/javascript" language="JavaScript1.2" src="source_pop1.js"></script> // ID - 2
<script type="text/javascript" language="JavaScript1.2" src="source_pop2.js"></script> // ID - 3
<script type="text/javascript" language="JavaScript1.2" src="source_pop3.js"></script> // ID - 4
and so on.
> I have 25 icons (images) on one page. Each image needs it's own popup menu.
If you want to have different Popup menus (there color, item, text,font and so on) you should create 25 different .js files with yourparameters. And call them from your page, for example:
<SCRIPT language=JavaScript1.2 src="source_pop.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript1.2 src="source_pop1.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript1.2 src="source_pop2.js" type=text/javascript></SCRIPT>
...
<SCRIPT language=JavaScript1.2 src="source_pop24.js" type=text/javascript></SCRIPT>
If you have different item text only you can use one
<SCRIPT language=JavaScript1.2 src="source_pop.js" type=text/javascript></SCRIPT>
file. But you should delete the following code:
var menuItems = [
["Next","testlink.htm"],
["Prev","testlink.htm"],
["Close","testlink.htm"],
];
dm_init();
and move it to the html page:
<body>
...
<SCRIPT language=JavaScript1.2 src="source_pop.js" type=text/javascript></SCRIPT>
<script type="text/javascript"> //first popup menu ID - 1
var menuItems = [
["Next","testlink.htm"],
["Prev","testlink.htm"],
["Close","testlink.htm"],
];
dm_init();
</SCRIPT>
<script type="text/javascript"> //second popup menu ID - 2
var menuItems = [
["Text","testlink.htm"],
["Text1","testlink.htm"],
["Text2","testlink.htm"],
];
dm_init();
</SCRIPT>
<script type="text/javascript"> //third popup menu ID - 3
var menuItems = [
["New_Text","testlink.htm"],
["New_Text1","testlink.htm"],
["New_Text2","testlink.htm"],
];
dm_init();
</SCRIPT>
...
<script type="text/javascript"> //twenty fourth popup menu ID - 3
var menuItems = [
["New","testlink.htm"],
["New","testlink.htm"],
["New","testlink.htm"],
];
dm_init();
</SCRIPT>
<img src="testimage.gif" width=200 onClick="return dm_popup(1, 1000, event);" style="cursor: hand;">
<img src="testimage.gif" width=200 onClick="return dm_popup(2, 1000, event);" style="cursor: hand;">
<img src="testimage.gif" width=200 onClick="return dm_popup(3, 1000, event);" style="cursor: hand;">
...
<img src="testimage.gif" width=200 onClick="return dm_popup(24, 1000, event);" style="cursor: hand;">
...
</body>
Q: I can't seem to figure out how to specify the width of individual javascript pulldown menu items. I would like to specify that each menu item on the horizontal take up just 113px regardless of the number of characters in the item. Is there a way of doing that?
A: You should use var itemStyles to set an individual item style. Forexample:
var itemStyles = [
["itemWidth=113px"]
];
var menuItems = [
["text 1", "link", "icon1", "icon2", "tip", "target", "0"],
["text 2", "link", "icon1", "icon2", "tip", "target", "0"],
["text 3", "link", "icon1", "icon2", "tip", "target", "0"],
];
Where "0" - style number in itemStyles that contains the parametersfor items width.
Use Deluxe Tuner GUI to create and assign individual styles.
Q: Is there a parameter in Tree Menu I can add and/or adjust in data.js toforce the menu text to wrap and add here to a set menu width?
A: You should use
tags, for example:
var tmenuItems = [
["line 1
line 2"],
];
Width of the menu you can set so:
var tmenuWidth = "500px";
Try that.
Try to specify units in "px".
var tmenuWidth = "182px";
It's necessary to specify exact value for Mozilla browsers. It helpsto position menus correctly.
You should set this parameter:
var tmenuHeight = "auto";