Recent Questions Open And Close Tree In Javascript
Q: I have a question that I cannot find in your FAQ section about your Javascript/DHTML Tree Menu.
Bought the whole set a few days ago and is very happy about it, I am uzzled & frustrated about one thing now though.
- = Link
+ = Link with subCat.
I have a menu that looks something like this:
- Home
+ Our products
+ FAQ
+ Stores
- Contact
+ Wholeseller
+ About us
Now every link here has a icon/s to the right that shows if the category is folded up or not. Trouble is that so has the - Home and - Contact that DON'T have any subitems! How to create dhtml menu so those two tree items won't get the rightsided icons?
The frustrating/confusing thing is if I place - Home or - Contact into lets say + Our products, the right side icon goes away and there it looks as I want it. But I NEED it to look this way in the top section.
A: You have icons in the top items on the right side in XP-style only.
You can set the following parameter to turn off XP-style:
var tXPStyle=0;
Q: I recently started using a new software program on my home page and am running into an issue with your drop down menu in css working with this software.
Basically no matter what I change the DmZorder to drop down menu in css always shows up behind the dhtml windows that I am trying to use.
After working with their support team they have stated that they believe the problem exists within the menus and I am attaching a screenshot they sent me.
Can you please assist me in resolving this issue?
A: Try to delete the following properties from #main style:
POSITION: absolute; TOP: 0px; LEFT: 0px;
See the attached example.
Set also units in "px":
var itemPadding="2px";
It helps to display the drop down menu in css correctly in all browsers.
Q: Actually, we figured out how to adjust the alignment of the text. What we would like to do is set a specific width for each item on the top level of the menu. Right now the width of the menu is based on the length of the item in that hotspot. We would like the width of each of those options to be the same.
A: You should use individual item styles. For example:
var itemStyles = [
["itemWidth=123px"], //style 0
["itemWidth=150px"], //style 1
];
var menuItems = [
["Home","testlink.html", , , , , "0", , , ], //style 0
["Product Info","", "deluxe-menu.files/icon1.gif", "deluxe-menu.files/icon1o.gif", , , "0", , , ], //style 0
["Text","", "deluxe-menu.files/icon1.gif", "deluxe-menu.files/icon1o.gif", , , "1", , , ], //style 1
Try that.
Q: I'm trying to set the frame parameters to frame name body. I have tried seven different text items: body, _body, frame name=body, framename=body, "framename=body", the relative URL, and the exact URL in the titemTarget parameter (common parameters). Nothing seems to work. It always sets the target to a new window. What text do I need to enter for the default parameter to be the body frame target?
Also, is there a way to expand only the menus and not the submenus? There doesn't seem to be a halfway point. Either all the menus are open, or all closed. If I set the default to hidden, it is non-functional. If I set it to expanded, that's not what I'm looking for either.
The menu looks good; other than these two problems it is functioning properly.
A: Please, check the following parameter:
var titemTarget="framename";
You can also set item target for each item
["|Home","testlink.htm", "default.files/icon1_s.gif", "default.files/icon1_so.gif", "", "Home Page Tip", "framename", "", "", ],
Try that.
> Also, is there a way to expand only the menus and not the submenus?
You want to expand only the main items when you load your page?
If it is so you can set expanded items by default.
If you want to expand specific items by default you should set "+"symbol at the beginning of item text.
["+Javascript/DHTML Tree: XP Style","", "default.files/xpicon1_s.gif", "", "", "XP Title Tip", "", "0", "", ], // this item is expanded by default
["|Home","testlink.htm", "default.files/icon1_s.gif", "default.files/icon1_so.gif", "", "Home Page Tip", "framename", "", "", ],
["|Product Info","", "default.files/icon2_s.gif",
"default.files/icon2_so.gif", "", "Product Info Tip", "", "", "", ], // this subitem is not expanded by default