Recent Questions
Q: Is it possible to have the "parent" item be purely an image but the dropdown portion of the menu being in regular text?
What we want to do is show emulate a basic text look for the main menu headings but the font is a special font so we have to use an image. When hovered over we'd like to replace the image (i.e do a rollover) with the same text but a different color.
A: Yes you can create such menu.
You should use images for the main items.
You should write your menu items in the following way:
["","", "images/vista1/btn_black.gif", "images/vista1/btn_black_blue.gif", , , , , , ],
["","", "images/vista1/btn_black.gif", "images/vista1/btn_black_blue.gif", , , , , , ],
Q: I will build menu for several books’ Contents, each book is more than 100 lines and has links. I think if all the books’ contents in 1 *.JS file then it is TOO LOONG!!.
Can I break it down to 1 book for 1*.JS ? How?
A: You cannot divide your menuItems parameter.
You can only use one .js file for your menu parameters and the other.js file for your menuItems = [...];
But you can do it in two ways.
1) You can try to use several menus on the one page, for example:
param.js // file with menu parameters (all parameters before menuItems = [...];)
menu1.js // menuItems for "AC-DC", "ANLOG"
menu2.js // menuItems for "DIGITAL", "WinXP"
menu3.js // menuItems for "MS-Word", "MS-Excel"
In these menu files you should write
menuItems = [
...
];
dm_init();
Then you should install your menu in the following way
<script type="text/javascript" src="param.js"></script>
<table>
...
<script type="text/javascript" src="menu1.js"></script>
...
<script type="text/javascript" src="menu2.js"></script>
...
<script type="text/javascript" src="menu3.js"></script>
But it will be easier to use vertical menu in such case
var isHorizontal=0;
var smColumns=1;
2) You can also try to add some code, see the attached example.
In the first file (@MY books (Multiple Col.js) I write menuItems for the first item "AC-DC".
Notice that you should delete comma at the end of the last item
var menuItems = [
["AC-DC","", , , , , , , , ],
["|@Book1","testlink.htm", , , , , , , , ],
...
["|@Book3","", , , , , , , , ],
["||CH02","", , , , , , , , ],
["||CH01","", , , , , , , , ] // delete comma at the end of the last item
];
In the second file (@MY books (1.js) you should write
menuItems = menuItems.concat(
[
["ANLOG","", , , , , , , , ],
["|@Book1","", , , , , , , , ],
["|@Book2","", , , , , , , , ],
["|@Book3","", , , , , , , , ] // delete comma at the end of the last item
]
);
In the third file (@MY books (2.js) you should write
menuItems = menuItems.concat(
[
["DIGITAL","", , , , , , , , ],
["|Item 1332","", , , , , , , , ],
["WinXP","", , , , , , , , ],
["|Item 1333","", , , , , , , , ],
["MS-Word","", , , , , , , , ],
["|Item 1334","", , , , , , , , ],
["MS-Excel","", , , , , , , , ],
["|Item 1335","", , , , , , , , ] // delete comma at the end of the last item
]
);
dm_init();
Notice that you should write dm_init(); function in the last file.
In the .html file you should write
...
<tr>
<script type="text/javascript" src="@MY books (Multiple Col.js"></script>
<script type="text/javascript" src="@MY books (1.js"></script>
<script type="text/javascript" src="@MY books (2.js"></script>
</tr>
I hope you understand me.
Q: I want to know how I can set a menu item to pressed
when a page is loaded in javascript drop down menus.
A: You should 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.
Q: I need a navigation bar dhtml where on the click of certain items, server side code on the page can be called and executed.
I need to create a multiple item select menu. Sothe menu would need to remain open and allow a user to selectmultiple items and would either submit onmouseout or maybe a “submitthese selections” menu item.
A: You can try to use Deluxe Tree in that case:
http://deluxe-tree.com
You can paste any html code inside item text, see example here:
http://deluxe-tree.com/data-samples/tree-menu1.js
["+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", "mailto:[email protected]", ""],
["|<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>"],
You should also add your own code, so your checkbox will workcorrectly.