Recent Questions Simple Css Tree Menu
Q: When I create a tree menu that can be expanded with the double arrows. I was wonder if there was a way to have the dhtml slide tree menu already expanded with I open the page the menu is on instead of having to expanded every time.
A: To expand items by default in Javascript/DHTML Tree you should add '+' symbolbefore item text.
Foe example:
["+Javascript/DHTML Tree: XP Style","", "default.files/xpicon1_s.gif", "", "", "XP Title Tip", "", "0", "", ],
["|Home","testlink.htm", "default.files/icon1_s.gif", "default.files/icon1_so.gif", "", "Home Page Tip", "", "", "", ],
["|Product Info","", "default.files/icon2_s.gif", "default.files/icon2_so.gif", "", "Product Info Tip", "", "", "", ],
["||What's New","testlink.htm", "default.files/iconarrs.gif", "", "", "", "", "", "", ],
["||Features","testlink.htm", "default.files/iconarrs.gif", "", "", "", "", "", "", ],
...
The following parameter expands all menu items by default:
var texpanded=1;
Q: I have not put your software into our site yet. I am only working on it in frontpage.
However when I have tried to look at it with the browser it does come up with the active x message.
Our site has no active x components otherwise.
A: Please, try to check browser settings. You can try to see JavaScript Tree Menuon the another computer.
On my computer I don't see such message.
Q: IHow can i make that the background-color will be standing behind the click in this part of dhtml menu slide?
A: JavaScript Tree Menu has only two states normal and mouseover, but
you can highlight menu items by default in two ways:
Try to do the following things:
- delete var pressedItem=1; parameter from your data file
- set correct parameter on each page before you call data file, forexample:
<noscript><a href="http://deluxe-menu.com">Javascript Menu by Deluxe-Menu.com</a></noscript>
<script type="text/javascript"> var dmWorkPath = "menudir/";</script>
<script type="text/javascript" src="menudir/dmenu.js"></script>
<script type="text/javascript"> var pressedItem=3;</script>
...
<script type="text/javascript" src="menudir/data.js"></script>
You can also 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 find more info here:
http://www.deluxe-menu.com/highlighted-items-sample.htmlQ: 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>"],