Recent Questions Submenu Tree Using Javascript Confluence
Q: I have read your FAQ’s on “When using mouse over tab menu, where do I place the text content related to the selected tab”, but I am still not understanding how to edit the script.
Cansomeone please assist me.
A: You should specify any Object ID name of the DIV.
See, for each item you should assign the ID property of the content
DIV (see data file with your menu parameters).
["Style Name","contentName", "", "", "", "", "1", "", "", ],
["-","", "", "", "", "", "0", "", "", ],
["Style Description","contentDescription", "", "", "", "", "", "", "", ],
["-","", "", "", "", "", "0", "", "", ],
["Style Variations","contentVariations", "", "", "", "", "", "", "", ],
["-","", "", "", "", "", "0", "", "", ],
["Empty","", "", "", "", "", "2", "", "", ],
And on your html page you should create DIV's with such ID.
You canset background image for these DIV's in styles.
<div id="contentName" style="height: 0%; visibility: hidden; background-image: url('img/back.jpg'); background-repeat:repeat-y;" class="tabPage">
<p align=center><img src="img/style01_title.gif" width=140 height=90 alt="Glass Style Tabs"></p>
You should paste your content here!!!!!
</div>
<div id="contentDescription" style="height: 0%; visibility: hidden;" class="tabPage">
<p align=center><img src="img/style01_title.gif" width=140 height=90 alt="Glass Style Tabs"></p>
You should paste your description here!!!!!
</div>
Q: I have 6 menu items that are ALL graphics...they can't just be background images because they all have graphic text, so the rollovers are unique to each menu item. I just need it to function like a typical rollover with images.
A: Yes, you can create such menu.
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: Is there a way to specify certian font styles escpecailly a hanging indent on the text of the javascript menu scroll?
A: You should use Individual styles, for example:
var itemStyles = [
["fontStyle=bold 12px Arial,Helvetica", "fontDecoration=none,underline"], // style 0
["fontStyle=normal 12px Arial,Helvetica", "fontDecoration=underline,underline"], // style 1
["fontStyle=normal 14px Arial,Helvetica", "fontDecoration=none,none"], // style 2
];
And assign styles to your items:
var menuItems = [
["1 Item","index.php","","","","_self","0",,,],
["2 Item","","","","","_self","1",,,],
["|Submenu Item","","","","","_self","2",,,],...
Q: I like your product a lot. These are the features that, unfortunately, cannot be done and hope that you can address them. I will place the order right away if these are resolved:
1. For each individual item, allow attaching a customized javascript to fire up "onclick" and "nomouseover".
2. Allow using a variable size icon for each item.
A: 1. You're able to use Javascript for each item, for example:
var tmenuitems = [
["item text", "javascript:your_code_here"]
];
Unfortunately, you can't assign onmouseover event to each item.
However, you can achieve this by using standard html objects withinitems, for example:
var tmenuitems = [
["<div onmouseover='your_code_here'>item text</div>", "index.html"]
];
2. DHTML Tree Menu uses constant icon size for all icons.
If you wantto use different icon dimensions, you can use standard <img>elements within items:
var tmenuitems = [
["<img src='icon.gif' width=10 height=10>item text", "index.html"]
];